diff --git a/src/config.rs b/src/config.rs index 6fbff29..3a064b7 100644 --- a/src/config.rs +++ b/src/config.rs @@ -100,10 +100,21 @@ impl Config { .prompt()?; let type_options: Vec<&str> = vec![ - "feat", "fix", "refactor", "perf", "style", "test", "docs", "build", "ops", "chore", + "feat Add a new feature", + "fix Correct a bug or error", + "change Change an existing feature", + "refactor Restructure existing code without altering the product behavior", + "chore Routine task, maintenance, or project management that does not directly modify the source code", + "test Add missing tests or correcting existing tests", + "docs Update or create documentation", + "ci Changes related to continuous integration or build environment configuration", + "remove Removal of obsolete or unnecessary code, files, or features", + "perf Improvement of code performance without changing its external behavior", + "revert Complete or partial reversal of a previous commit", ]; let _type = Select::new("Type:", type_options).prompt()?; + let _type = _type.split_whitespace().collect::>()[0]; let scope = Text::new("Scope (optional):").prompt_skippable()?; @@ -123,7 +134,7 @@ impl Config { }; let splited_branch = linear_branch.split('-').collect::>(); - if splited_branch.len() > 1 { + if splited_branch.len() > 1 && splited_branch[1].parse::().is_ok() { pr_name = format!( "{} [{}-{}]", pr_name,