#git #conventional #conventional-changelog #conventional-commits #parser #commit #parse

conventional_commit_parser

A rust implementation of the conventional commit specification

13 releases (6 breaking)

0.9.4 Jan 17, 2022
0.9.3 Nov 21, 2021
0.8.0 Nov 1, 2021

#997 in Parser implementations

Download history 436/week @ 2023-02-08 559/week @ 2023-02-15 488/week @ 2023-02-22 252/week @ 2023-03-01 351/week @ 2023-03-08 414/week @ 2023-03-15 242/week @ 2023-03-22 473/week @ 2023-03-29 222/week @ 2023-04-05 310/week @ 2023-04-12 436/week @ 2023-04-19 470/week @ 2023-04-26 613/week @ 2023-05-03 432/week @ 2023-05-10 550/week @ 2023-05-17 394/week @ 2023-05-24

2,038 downloads per month
Used in 5 crates (3 directly)

Custom license

26KB
495 lines

Conventional commit parser

Latest Version Conventional Commits License

A rust implementation of the conventional commit specification.

Example

use conventional_commit_parser::parse;
use conventional_commit_parser::commit::*;
let message = r#"fix: correct minor typos in code

see the issue for details

on typos fixed.

Reviewed-by: Z
Refs #133"#;

let conventional_commit = parse(message)?;

assert_eq!(conventional_commit.commit_type, CommitType::BugFix);
assert_eq!(conventional_commit.summary, "correct minor typos in code".to_string());
assert_eq!(conventional_commit.body, Some(r#"see the issue for details

on typos fixed."#.to_string()));

assert_eq!(conventional_commit.footers, vec![
    Footer {token: "Reviewed-by".to_string(), content: "Z".to_string()},
    Footer {token: "Refs".to_string(), content: "133".to_string(),}
]);

Licence

All the code in this repository is released under the MIT License, for more information take a look at the LICENSE file.

Dependencies

~2.5MB
~54K SLoC