Crate conventional_commits

Crate conventional_commits 

Source
Expand description

§Conventional Commits Validator

A lightweight library for validating Git commit messages according to the Conventional Commits specification.

§Usage

use conventional_commits::{validate_commit, CommitType};

let message = "feat: add new user authentication";
match validate_commit(message) {
    Ok(commit) => {
        println!("Valid commit: {:?}", commit.commit_type);
    }
    Err(e) => {
        eprintln!("Invalid commit: {}", e);
    }
}

Structs§

ConventionalCommit
Represents a parsed conventional commit
ValidationConfig
Configuration for commit validation

Enums§

CommitType
Represents the type of a conventional commit
CommitValidationError
Errors that can occur when validating commit messages

Functions§

validate_commit
Validates a commit message according to Conventional Commits specification
validate_commit_with_config
Validates a commit message with custom configuration