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

Commit 5304c66

Browse files
committed
feat: Add an option for the issue type, if issue_reference_required is set to true in .dod.yml
TODO:
1 parent 29f03fa commit 5304c66

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/cli.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ pub(crate) enum Commands {
3636
#[arg(short, long)]
3737
message: String,
3838
/// Optional flag to skip verification of the checklist.
39-
/// This is useful for quick commits without checklist confirmation.
4039
#[arg(long, default_value_t = false)]
4140
no_verify: bool,
41+
/// Optional flag for an issue reference.
42+
#[arg(long, default_value_t = false)]
43+
issue: bool,
4244
},
4345
}

src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ fn main() -> anyhow::Result<()> {
5252
let status = git::status()?;
5353
println!("{}", format!("Git Status:\n{}", status).green());
5454
}
55-
cli::Commands::Commit { r#type, scope, message, no_verify} => {
55+
cli::Commands::Commit { r#type, scope, message, no_verify, issue} => {
5656
println!("--- Committing changes ---");
5757
let scope_part = scope.map_or("".to_string(), |s| format!("({})", s));
5858
let header = format!("{}{}: {}", r#type, scope_part, message);
@@ -70,7 +70,7 @@ fn main() -> anyhow::Result<()> {
7070
println!("Commit aborted.");
7171
return Ok(());
7272
}
73-
if config.issue_reference_required.unwrap_or(false) {
73+
if config.issue_reference_required.unwrap_or(false) && !issue {
7474
println!("{}", "Issue reference is required for commits.".red());
7575
return Err(anyhow::anyhow!("Issue reference required"));
7676
}

0 commit comments

Comments
 (0)