|
1 | 1 | # check-commit |
2 | | -A TBD-friendly pre-commit tool that enforces your team's Definition of Done using an interactive checklist. |
| 2 | + |
| 3 | +A TBD-friendly pre-commit tool that enforces your team's Definition of Done (DoD) using an interactive checklist. |
| 4 | + |
| 5 | +This tool is designed for teams practicing Trunk-Based Development who want to automate their quality standards without the friction of a formal Pull Request process. It makes your team's DoD an active, developer-centric part of the commit workflow. |
| 6 | + |
| 7 | +The long-term goal is to integrate this functionality directly into the [`tbdflow`](https://github.com/cladam/tbdflow) CLI. |
| 8 | + |
| 9 | +# How It Works |
| 10 | +`check-commit` is a smart wrapper around `git commit`. Before it executes the commit, it looks for a `.dod.yml` file in your repository's root. |
| 11 | + |
| 12 | +If found, it presents an interactive checklist to the developer in the terminal. If the developer confirms the checklist, the tool proceeds to execute the `git commit` command with the original arguments. |
| 13 | + |
| 14 | +This creates a lightweight, non-obtrusive quality gate right at the moment of commit. |
| 15 | + |
| 16 | +## Configuration (`.dod.yml`) |
| 17 | +The checklist is configured in a `.dod.yml` file in your project's root. This makes your team's Definition of Done a version-controlled artifact that lives with your code. |
| 18 | + |
| 19 | +**Example** `.dod.yml`: |
| 20 | +```yaml |
| 21 | +# --- Optional Issue Tracker Integration --- |
| 22 | +# If true, the tool will require the --issue <ID> flag to be used, |
| 23 | +# ensuring all work is traceable. |
| 24 | +issue_reference_required: true |
| 25 | + |
| 26 | +# --- Interactive Checklist --- |
| 27 | +# This list is presented to the developer before every commit. |
| 28 | +checklist: |
| 29 | + - "Code is clean, readable, and adheres to team coding standards." |
| 30 | + - "All relevant automated tests (unit, integration) pass successfully." |
| 31 | + - "New features or bug fixes are covered by appropriate new tests." |
| 32 | + - "Security implications of this change have been considered." |
| 33 | + - "Relevant documentation (code comments, READMEs, etc.) is updated." |
| 34 | +``` |
| 35 | +
|
| 36 | +## Getting Started (Development) |
| 37 | +This project is currently in the planning and early development phase. |
| 38 | +
|
| 39 | +The initial proof-of-concept will be built in Rust. |
| 40 | +
|
| 41 | +Roadmap: |
| 42 | +
|
| 43 | +* Parse command-line arguments for `git commit`. |
| 44 | +* Read and parse the `.dod.yml` configuration file. |
| 45 | +* Implement the interactive checklist using a TUI library. |
| 46 | +* Execute `git commit` upon successful confirmation. |
| 47 | +* Integrate this logic into the `tbdflow commit` command. |
0 commit comments