Skip to content
This repository was archived by the owner on Aug 11, 2025. It is now read-only.

Commit 4b3e99e

Browse files
committed
fix: Fixed a bug in main, it always showed the confirmation prompt
1 parent ead996e commit 4b3e99e

2 files changed

Lines changed: 13 additions & 11 deletions

File tree

.dod.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# --- Optional Issue Tracker Integration ---
1515
# If true, the check-commit tool will require the --issue <ID> flag
1616
# to be used with the commit command, ensuring all work is traceable.
17-
issue_reference_required: false
17+
issue_reference_required: true
1818

1919
checklist:
2020
# --- Code Quality & Testing (High-Impact Checks) ---

src/main.rs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,19 @@ fn main() -> anyhow::Result<()> {
6363

6464
if !no_verify {
6565
let checked = run_checklist_interactive(&config.checklist)?;
66-
if Confirm::with_theme(&ColorfulTheme::default())
67-
.with_prompt("Warning: Not all DoD items were checked. Proceed by adding a 'TODO' list to the commit message? (Y/n)")
68-
.interact()?
69-
{
70-
let todo_footer = build_todo_footer(&config.checklist, &checked);
71-
commit_message.push_str(&todo_footer);
72-
} else {
73-
println!("Commit aborted.");
74-
return Ok(());
66+
if checked.len() != config.checklist.len() {
67+
if Confirm::with_theme(&ColorfulTheme::default())
68+
.with_prompt("Warning: Not all DoD items were checked. Proceed by adding a 'TODO' list to the commit message? (Y/n)")
69+
.interact()?
70+
{
71+
let todo_footer = build_todo_footer(&config.checklist, &checked);
72+
commit_message.push_str(&todo_footer);
73+
} else {
74+
println!("Commit aborted.");
75+
return Ok(());
76+
}
7577
}
76-
if config.issue_reference_required.unwrap_or(false) && issue {
78+
if config.issue_reference_required.unwrap_or(false) && !issue {
7779
println!("{}", "Issue reference is required for commits.".red());
7880
return Err(anyhow::anyhow!("Issue reference required"));
7981
}

0 commit comments

Comments
 (0)