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

Commit cc7b453

Browse files
committed
feat: Add a --no-verify flag to skip over the checklist
1 parent 728e4b7 commit cc7b453

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

src/cli.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,9 @@ pub(crate) enum Commands {
3535
/// The descriptive commit message.
3636
#[arg(short, long)]
3737
message: String,
38+
/// Optional flag to skip verification of the checklist.
39+
/// This is useful for quick commits without checklist confirmation.
40+
#[arg(long, default_value_t = false)]
41+
no_verify: bool,
3842
},
3943
}

src/main.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,17 @@ fn main() -> anyhow::Result<()> {
4242
let status = git::status()?;
4343
println!("{}", format!("Git Status:\n{}", status).green());
4444
}
45-
cli::Commands::Commit { r#type, scope, message} => {
45+
cli::Commands::Commit { r#type, scope, message, no_verify} => {
4646
println!("--- Committing changes ---");
47-
if config.issue_reference_required.unwrap_or(false) {
48-
println!("{}", "Issue reference is required for commits.".red());
49-
return Err(anyhow::anyhow!("Issue reference required"));
50-
}
51-
if !run_checklist_interactive(&config.checklist)? {
52-
println!("Not all checklist items confirmed. Commit aborted.");
53-
return Ok(());
47+
if !no_verify {
48+
if config.issue_reference_required.unwrap_or(false) {
49+
println!("{}", "Issue reference is required for commits.".red());
50+
return Err(anyhow::anyhow!("Issue reference required"));
51+
}
52+
if !run_checklist_interactive(&config.checklist)? {
53+
println!("Not all checklist items confirmed. Commit aborted.");
54+
return Ok(());
55+
}
5456
}
5557
let scope_part = scope.map_or("".to_string(), |s| format!("({})", s));
5658
let header = format!("{}{}: {}", r#type, scope_part, message);

0 commit comments

Comments
 (0)