Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files

- repo: local
hooks:
- id: cargo-fmt
name: cargo fmt
description: Format files with rustfmt.
entry: cargo fmt --all
language: system
types: [rust]
pass_filenames: false

- id: cargo-clippy
name: cargo clippy
description: Lint rust sources
entry: cargo clippy --all-targets --all-features -- -D warnings
language: system
types: [rust]
pass_filenames: false

- id: cargo-test
name: cargo test
description: Run cargo test
entry: cargo test --all
language: system
types: [rust]
pass_filenames: false
36 changes: 0 additions & 36 deletions CHANGELOG.md

This file was deleted.

11 changes: 11 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@ rustup component add clippy rustfmt
cargo fetch
```

### Install Pre-Commit Hooks

We use [`pre-commit`](https://pre-commit.com/) to automatically run formatters, linters, and tests before each commit. This prevents failing builds in CI.

1. Ensure `pre-commit` is installed on your system (`pip install pre-commit`, `brew install pre-commit`, etc.)
2. Install the git hook scripts:

```bash
pre-commit install
```

### Build the Project

```bash
Expand Down
21 changes: 0 additions & 21 deletions LICENSE.md

This file was deleted.

38 changes: 0 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,44 +185,6 @@ The tool ensures that:

## Development

### Project Structure

```
git-editor/
├── src/
│ ├── main.rs # Entry point and operation mode handling
│ ├── args.rs # Command line argument parsing and Git URL cloning
│ ├── rewrite/ # Git history rewriting logic
│ │ ├── mod.rs # Module definition
│ │ ├── rewrite_all.rs # Full repository history rewriting
│ │ ├── rewrite_specific.rs # Interactive commit selection
│ │ └── rewrite_range.rs # Interactive range selection and editing
│ ├── utils/ # Utility modules
│ │ ├── mod.rs # Module definition
│ │ ├── types.rs # Type definitions and custom Result
│ │ ├── validator.rs # Input validation for all modes
│ │ ├── datetime.rs # Date and time functions
│ │ ├── commit_history.rs # Git commit operations
│ │ ├── prompt.rs # Interactive user prompts
│ │ ├── git_clone.rs # Git URL detection and repository cloning
│ │ ├── git_config.rs # Git configuration reading (cross-platform)
│ │ └── simulation.rs # Simulation mode and preview functionality
│ └── lib.rs # Library interface
├── tests/
│ └── integration_tests.rs # Comprehensive integration tests (15 tests)
├── .github/workflows/ # CI/CD pipelines
│ ├── ci-cd.yaml # Main build and test pipeline
│ ├── release.yaml # Multi-platform release automation
│ ├── coverage.yml # Code coverage reporting
│ └── multi-platform-test.yml # Cross-platform testing
├── Cargo.toml # Project dependencies and metadata
├── Dockerfile # Docker configuration
├── Makefile # Build automation and development commands
├── CLAUDE.md # Development guidance for AI assistants
├── CHANGELOG.md # Version history and release notes
└── LICENSE # MIT license
```

### Testing

The project includes comprehensive test coverage with both unit and integration tests:
Expand Down
17 changes: 17 additions & 0 deletions src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ pub struct Args {
#[arg(long = "time", help = "Edit only timestamps in range mode (-x)")]
pub edit_time: bool,

#[arg(
long = "skip-range-check",
help = "Skip the minimum date range check (allows tightly packed commit timestamps)"
)]
pub skip_range_check: bool,

#[arg(
long = "docs",
help = "Open comprehensive documentation in the browser"
Expand Down Expand Up @@ -217,6 +223,7 @@ impl Args {
edit_message: false,
edit_author: false,
edit_time: false,
skip_range_check: false,
docs: false,
_temp_dir: None,
};
Expand Down Expand Up @@ -297,6 +304,7 @@ mod tests {
edit_message: false,
edit_author: false,
edit_time: false,
skip_range_check: false,
docs: false,
_temp_dir: None,
};
Expand Down Expand Up @@ -327,6 +335,7 @@ mod tests {
edit_message: false,
edit_author: false,
edit_time: false,
skip_range_check: false,
docs: false,
_temp_dir: None,
};
Expand All @@ -352,6 +361,7 @@ mod tests {
edit_message: false,
edit_author: false,
edit_time: false,
skip_range_check: false,
docs: false,
_temp_dir: None,
};
Expand All @@ -377,6 +387,7 @@ mod tests {
edit_message: false,
edit_author: false,
edit_time: false,
skip_range_check: false,
docs: false,
_temp_dir: None,
};
Expand Down Expand Up @@ -404,6 +415,7 @@ mod tests {
edit_message: false,
edit_author: false,
edit_time: false,
skip_range_check: false,
docs: false,
_temp_dir: None,
};
Expand All @@ -430,6 +442,7 @@ mod tests {
edit_message: false,
edit_author: false,
edit_time: false,
skip_range_check: false,
docs: false,
_temp_dir: None,
};
Expand All @@ -454,6 +467,7 @@ mod tests {
edit_message: false,
edit_author: false,
edit_time: false,
skip_range_check: false,
docs: false,
_temp_dir: None,
};
Expand All @@ -478,6 +492,7 @@ mod tests {
edit_message: false,
edit_author: false,
edit_time: false,
skip_range_check: false,
docs: false,
_temp_dir: None,
};
Expand Down Expand Up @@ -506,6 +521,7 @@ mod tests {
edit_message: false,
edit_author: false,
edit_time: false,
skip_range_check: false,
docs: true,
_temp_dir: None,
};
Expand Down Expand Up @@ -533,6 +549,7 @@ mod tests {
edit_message: false,
edit_author: false,
edit_time: false,
skip_range_check: false,
docs: true,
_temp_dir: None,
};
Expand Down
Loading
Loading