#conventional-commits #commit-message #message-parser #specification #git

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

#2467 in Parser implementations

Download history 2960/week @ 2024-03-14 3661/week @ 2024-03-21 2736/week @ 2024-03-28 2884/week @ 2024-04-04 4664/week @ 2024-04-11 3624/week @ 2024-04-18 2215/week @ 2024-04-25 2640/week @ 2024-05-02 2710/week @ 2024-05-09 2631/week @ 2024-05-16 3168/week @ 2024-05-23 3671/week @ 2024-05-30 2912/week @ 2024-06-06 5786/week @ 2024-06-13 3216/week @ 2024-06-20 1647/week @ 2024-06-27

14,164 downloads per month
Used in 15 crates (6 directly)

Custom license

27KB
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.2–2.9MB
~58K SLoC