pub enum ChangeKind {
Show 13 variants
Feat,
Fix,
Perf,
Refactor,
Docs,
Test,
Chore,
Ci,
Style,
Build,
Revert,
Merge,
Other,
}Expand description
What a conventional commit says it did.
The set is the one the repository’s own commit convention uses; a commit whose subject
does not parse is ChangeKind::Other and still appears, because a changelog that
silently drops what it cannot classify is a changelog that lies by omission.
Variants§
Feat
A capability a person did not have before.
Fix
Behaviour that was wrong and is not any more.
Perf
Performance, with the behaviour unchanged.
Refactor
Structure, with the behaviour unchanged.
Docs
Documentation.
Test
Tests.
Chore
The build, the pipeline, the tooling.
Ci
Continuous integration.
Style
Formatting, with the behaviour unchanged.
Build
The build system or its dependencies.
Revert
A change that undoes another.
Merge
An integration: one line of work brought into another.
Not in the conventional-commit specification, and in this repository’s history 38
times and counting, because integration here is a deliberate act with a subject
somebody writes — merge: bring origin/master into feature/x — and not the sentence
git merge composes. Declaring it is what lets the validator hold those subjects to
the same width and the same references as every other commit, instead of either
refusing a convention this project practises or exempting it from being checked at
all. The changelog never renders it: commits::in_range reads the log with
--no-merges, so a merge commit is not a release entry however its subject is
spelled.
Other
A commit whose subject does not parse as a conventional commit.
Implementations§
Source§impl ChangeKind
impl ChangeKind
Sourcepub const WORDS: &'static [&'static str]
pub const WORDS: &'static [&'static str]
The type words, in the order Self::TABLE declares them.
use majordomus_cli::release::ChangeKind;
assert_eq!(ChangeKind::WORDS.first(), Some(&"feat"));
assert!(ChangeKind::WORDS.iter().all(|w| ChangeKind::parse(w) != ChangeKind::Other));Sourcepub fn parse(word: &str) -> ChangeKind
pub fn parse(word: &str) -> ChangeKind
The kind one conventional-commit type word names.
Sourcepub fn word(self) -> Option<&'static str>
pub fn word(self) -> Option<&'static str>
The word this kind is written as, or None for ChangeKind::Other, which is not
a type anybody writes.
The inverse of ChangeKind::parse over the one table, so the two cannot disagree
about which words exist:
use majordomus_cli::release::model::ChangeKind;
assert_eq!(ChangeKind::parse("feat").word(), Some("feat"));
assert_eq!(ChangeKind::Perf.word(), Some("perf"));
// `Other` is what an unknown word parses to, and it is not itself a word: a
// validator quoting the vocabulary back must not offer it as something to type.
assert_eq!(ChangeKind::parse("nonsense"), ChangeKind::Other);
assert_eq!(ChangeKind::Other.word(), None);
// every word the vocabulary advertises round-trips through both directions
for word in ChangeKind::WORDS {
assert_eq!(ChangeKind::parse(word).word(), Some(*word), "{word} round-trips");
}Trait Implementations§
Source§impl Clone for ChangeKind
impl Clone for ChangeKind
Source§fn clone(&self) -> ChangeKind
fn clone(&self) -> ChangeKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ChangeKind
Source§impl Debug for ChangeKind
impl Debug for ChangeKind
Source§impl<'de> Deserialize<'de> for ChangeKind
impl<'de> Deserialize<'de> for ChangeKind
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ChangeKind
Source§impl JsonSchema for ChangeKind
impl JsonSchema for ChangeKind
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl Ord for ChangeKind
impl Ord for ChangeKind
Source§fn cmp(&self, other: &ChangeKind) -> Ordering
fn cmp(&self, other: &ChangeKind) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for ChangeKind
impl PartialEq for ChangeKind
Source§fn eq(&self, other: &ChangeKind) -> bool
fn eq(&self, other: &ChangeKind) -> bool
self and other values to be equal, and is used by ==.Source§impl PartialOrd for ChangeKind
impl PartialOrd for ChangeKind
Source§impl Serialize for ChangeKind
impl Serialize for ChangeKind
impl StructuralPartialEq for ChangeKind
Auto Trait Implementations§
impl Freeze for ChangeKind
impl RefUnwindSafe for ChangeKind
impl Send for ChangeKind
impl Sync for ChangeKind
impl Unpin for ChangeKind
impl UnsafeUnpin for ChangeKind
impl UnwindSafe for ChangeKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.