#conventional-commits #commit-message #config-file #validation #linter #linting #lint

app change-scribe

A tool that validates that commit messages follow the conventional commit format, and lints them according to a configuration file

1 unstable release

0.1.0 Aug 29, 2024

#1464 in Development tools

GPL-3.0 license

25KB
561 lines

change-scribe

change-scribe is a tool that validates that commit messages follow the conventional commit format, and lints them according to a configuration file.

Installation

Installation is done via cargo:

cargo install change-scribe

To build change-scribe from source, clone the repository and run:

cargo build --release

The binary will be located at target/release/change-scribe.

Usage

To use change-scribe:

change-scribe "fix: resolved that bug"

This validates the message according to the default configuration. The commit message could also be passed via stdin:

echo "fix: resolved that bug" | change-scribe -

To apply a custom config, use the --config flag:

change-scribe --config path/to/config.toml "fix: resolved that bug"

By default, change-scribe reads configuration from either change-scribe.toml or .change-scribe.toml in the current directory.

Linting rules

Type

type.enum

Ensures that the commit type is on of the entered values. * is a wildcard that matches any type.

Default:

type.enum = ["*"]

type.min-length

Ensures that the commit type is at least the entered length.

Default:

type.min-length = 0

type.max-length

Ensures that the commit type is at most the entered length.

Default:

type.max-length = 18446744073709551615

Scope

scope.enum

Ensures that the commit scope is on of the entered values. * is a wildcard that matches any scope.

Default:

scope.enum = ["*"]

scope.required

Ensures that a commit has a scope.

Default:

scope.required = false

Dependencies

~6–12MB
~153K SLoC