6 releases (breaking)
0.5.0 | Nov 22, 2019 |
---|---|
0.4.1 | Aug 19, 2019 |
0.3.0 | Aug 17, 2019 |
0.2.0 | Aug 17, 2019 |
0.1.0 | Aug 15, 2019 |
#2304 in Parser implementations
Used in jilu
37KB
775 lines
Quick Start
-
Add the crate to your
Cargo.toml
:cargo install cargo-edit cargo add conventional
-
Import the
Commit
type and theSimple
trait to parse a commit string, and query its different components as string slices:use conventional::{Commit, Simple as _}; let commit = Commit::new("feat(conventional commit): this is it!").unwrap(); assert_eq!("feat", commit.type_()); assert_eq!("conventional commit", commit.scope()); assert_eq!("this is it!", commit.description()); assert_eq!(None, commit.body());
-
Upgrade to
Typed
components for strongly typed access:use conventional::{Commit, Typed as _}; let commit = Commit::new("feat(conventional commit): this is it!").unwrap(); assert_eq!(Type("feat"), commit.type_());
-
Check out tools like Jilu for an example of library usage.
Dependencies
~1MB
~19K SLoC