6 个版本 (破坏性更新)
| 0.5.0 | 2019年11月22日 |
|---|---|
| 0.4.1 | 2019年8月19日 |
| 0.3.0 | 2019年8月17日 |
| 0.2.0 | 2019年8月17日 |
| 0.1.0 | 2019年8月15日 |
#2414 in 解析器实现
每月 53 次下载
用于 jilu
37KB
775 行
快速入门
-
将crate添加到您的
Cargo.tomlcargo install cargo-edit cargo add conventional -
导入
Commit类型以及Simple特性以解析提交字符串,并查询其不同组件作为字符串切片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()); -
升级到
Typed组件以进行强类型访问use conventional::{Commit, Typed as _}; let commit = Commit::new("feat(conventional commit): this is it!").unwrap(); assert_eq!(Type("feat"), commit.type_()); -
查看如 Jilu 的示例以了解库的使用。
依赖关系
~1MB
~18K SLoC