standard-commit 0.1.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: 25.22 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: 20s 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

Conventional commit parsing, validation, and formatting.

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

Main entry points

  • [parse] — parse a commit message into a [ConventionalCommit]
  • [lint] — validate a message against a [LintConfig]
  • [format] — render a [ConventionalCommit] back to a well-formed 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());