pub enum Mode {
Pre1_0Strict,
Semver,
}Expand description
How this project turns a measured impact into the version it owes.
Semantic versioning hands 0.y.z a blanket exemption — “anything MAY change at any
time” — and Elm refuses the exemption by starting every package at 1.0.0, because a
rule with an escape hatch is a rule about when to use the hatch. This repository is 0.x
and has not earned 1.0.0, so neither answer is available: demanding major would
demand 1.0.0 for a single removal, and granting the exemption would let a breaking
change ship as a patch.
So below 1.0.0 the floor is a minor. Any movement of the surface, gone or new, is at
least a minor release; only an unchanged surface owes nothing. That is the strongest
signal 0.x has, and a removal is still named as breaking whatever the verdict, so the
evidence does not quietly become a minor along with the number.
At 1.0.0 the shift ends: Mode::Semver is the ordinary rule, and the transition is
one line of Policy::required_of.
use majordomus_cli::release::compat::{Mode, Policy};
use majordomus_cli::release::version::Version;
assert_eq!(Policy::for_version(Version::parse("0.9.0").unwrap()).mode, Mode::Pre1_0Strict);
assert_eq!(Policy::for_version(Version::parse("1.0.0").unwrap()).mode, Mode::Semver);Variants§
Pre1_0Strict
Below 1.0.0: breaking changes are allowed, and cost a minor rather than nothing.
Semver
At or above 1.0.0: the impact is the requirement.
Trait Implementations§
impl Copy for Mode
Source§impl<'de> Deserialize<'de> for Mode
impl<'de> Deserialize<'de> for Mode
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 Mode
Source§impl JsonSchema for Mode
impl JsonSchema for Mode
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 moreimpl StructuralPartialEq for Mode
Auto Trait Implementations§
impl Freeze for Mode
impl RefUnwindSafe for Mode
impl Send for Mode
impl Sync for Mode
impl Unpin for Mode
impl UnsafeUnpin for Mode
impl UnwindSafe for Mode
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<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.