standard-commit 0.2.0

Conventional commit parsing, validation, and formatting
Documentation
  • Coverage
  • 100%
    24 out of 24 items documented1 out of 1 items with examples
  • Size
  • Source code size: 26.39 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 3.01 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 24s Average build duration of successful builds.
  • all releases: 22s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • driftsys/git-std
    0 0 28
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • stasson

standard-commit

Conventional commit parsing, validation, and formatting.

Implements the Conventional Commits specification as a pure library — no I/O, no git operations, no terminal output.

Entry points

  • parse — parse a commit message into a ConventionalCommit
  • lint — validate a message against a LintConfig
  • format — render a ConventionalCommit back to a string

Example

use standard_commit::{parse, format, lint, LintConfig};

let commit = parse("feat(auth): add OAuth2 PKCE flow").unwrap();
assert_eq!(commit.r#type, "feat");
assert_eq!(commit.scope.as_deref(), Some("auth"));

// Round-trip: format back to string
assert_eq!(format(&commit), "feat(auth): add OAuth2 PKCE flow");

// Lint with default rules
let errors = lint("feat: add login", &LintConfig::default());
assert!(errors.is_empty());

Part of git-std

This crate is one of four libraries powering git-std, a single binary for conventional commits, versioning, changelog, and git hooks.

License

MIT