pub fn kind_of(paths: &[String]) -> Option<ChangeKind>Expand description
The kind a set of paths suggests, from what the paths are.
Only the cases where the paths decide it on their own: a change that is entirely tests is a test change, one that is entirely documentation is a documentation change, one that is entirely pipeline is a pipeline change. Everything else is left unset, because the difference between a feature, a fix and a refactor is in the diff’s meaning and not in its file names, and a planner that guessed would be putting the wrong word in front of every commit in the history.
use majordomus_cli::commit::plan::kind_of;
use majordomus_cli::release::ChangeKind;
assert_eq!(kind_of(&["docs/COMMIT.md".into()]), Some(ChangeKind::Docs));
// a source change could be a feature, a fix or a refactor; the file names do not say
assert_eq!(kind_of(&["src/a.rs".into()]), None);