(pattern: CommitPattern)
| 8 | use crate::commit_pattern::CommitPattern; |
| 9 | |
| 10 | pub fn make_message_commit(pattern: CommitPattern) -> Result<String> { |
| 11 | let mut message_inquirer = MessageInquirer::new(pattern.clone()); |
| 12 | let skip_commit = pattern.skip_commit; |
| 13 | if !skip_commit.contains(&"commit_type".to_owned()) { |
| 14 | message_inquirer.type_choice()?; |
| 15 | } |
| 16 | if !skip_commit.contains(&"commit_scope".to_owned()) { |
| 17 | message_inquirer.scope_choice()?; |
| 18 | } |
| 19 | if !skip_commit.contains(&"commit_description".to_owned()) { |
| 20 | message_inquirer.description()?; |
| 21 | } |
| 22 | if !skip_commit.contains(&"commit_body".to_owned()) { |
| 23 | message_inquirer.body()?; |
| 24 | } |
| 25 | if !skip_commit.contains(&"commit_footer".to_owned()) { |
| 26 | message_inquirer.footer()?; |
| 27 | } |
| 28 | message_inquirer.message() |
| 29 | } |
| 30 | |
| 31 | struct MessageInquirer { |
| 32 | commit_builder: MessageBuilder, |
no test coverage detected