#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

#2742 in Parser implementations

Download history 3649/week @ 2024-11-17 1825/week @ 2024-11-24 2386/week @ 2024-12-01 2602/week @ 2024-12-08 1809/week @ 2024-12-15 1222/week @ 2024-12-22 951/week @ 2024-12-29 3277/week @ 2025-01-05 1870/week @ 2025-01-12 6920/week @ 2025-01-19 2371/week @ 2025-01-26 1315/week @ 2025-02-02 1351/week @ 2025-02-09 1734/week @ 2025-02-16 1333/week @ 2025-02-23 1582/week @ 2025-03-02

6,082 downloads per month
Used in 6 crates

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.8MB
~56K SLoC