docs.rs failed to build conventional-0.5.0
Please check the
build logs for more information.
See
Builds for ideas on how to fix a failed build,
or
Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault,
open an issue.
A parser library for the Conventional Commit specification.
Example
use indoc::indoc;
use conventional::{Commit, Error, Simple as _};
use std::str::FromStr;
fn main() -> Result<(), Error> {
let message = indoc!("
docs(example)!: add tested usage example
This example is tested using Rust's doctest capabilities. Having this
example helps people understand how to use the parser.
BREAKING CHANGE: Going from nothing to something, meaning anyone doing
nothing before suddenly has something to do. That sounds like a change
in your break.
Co-Authored-By: Lisa Simpson <lisa@simpsons.fam>
Closes #12
");
let commit = Commit::new(message)?;
assert_eq!(commit.type_(), "docs");
assert_eq!(commit.scope(), Some("example"));
assert_eq!(commit.description(), "add tested usage example");
assert!(commit.body().unwrap().contains("helps people understand"));
assert!(commit.breaking());
assert!(commit.footers().get(0).unwrap().value().contains("That sounds like a change"));
assert_eq!(commit.footers().get(1).unwrap().token(), "Co-Authored-By");
assert_eq!(commit.footers().get(1).unwrap().value(), "Lisa Simpson <lisa@simpsons.fam>");
assert_eq!(commit.footers().get(2).unwrap().separator(), " #");
assert_eq!(commit.footers().get(2).unwrap().value(), "12");
# Ok(())
}