Skip to main content

A fast git commit message linter written in Rust

Project description

Mixed Pickles

A fast git commit message linter written in Rust. Validates commit messages against best practices and provides actionable suggestions.

Installation

Python (Recommended)

pip install mixed-pickles

Or with uv:

uv pip install mixed-pickles

Rust

cargo install mixed-pickles

Or build from source:

git clone https://github.com/rommeld/mixed-pickles.git
cd mixed-pickles
cargo build --release

What It Checks

Validation Default Severity Description
WipCommit Error WIP markers, fixup!, squash!
ShortCommit Warning Messages below threshold (default: 30 chars)
NonImperative Warning Non-imperative mood ("Added" vs "Add")
VagueLanguage Warning Generic phrases ("fix bug", "update code")
MissingReference Info No issue reference (#123, PROJ-456)
InvalidFormat Info Not following conventional commits

Usage

CLI

# Analyze all commits in current repo
mixed-pickles

# Analyze last 10 commits
mixed-pickles --limit 10

# Analyze specific repo
mixed-pickles --path /path/to/repo

# Strict mode (warnings become errors)
mixed-pickles --strict

# Customize severity
mixed-pickles --error short,vague --ignore ref

# Quiet mode (output only on issues)
mixed-pickles --quiet

# Run only on specific branches (supports glob patterns)
mixed-pickles --branch main --branch develop
mixed-pickles --branch "feature/*" --branch "release/**"

Python API

import mixed_pickles

# Basic analysis - auto-loads pyproject.toml config
mixed_pickles.analyze_commits()

# Analyze with options
mixed_pickles.analyze_commits(
    path=".",           # Repository path
    limit=10,           # Number of commits
    quiet=True,         # Suppress output unless issues
    strict=True         # Treat warnings as errors
)

# Disable auto-loading of config file
mixed_pickles.analyze_commits(use_config=False)

# Load config from pyproject.toml or .mixed-pickles.toml
config = mixed_pickles.ValidationConfig.discover()
config = mixed_pickles.ValidationConfig.discover("/path/to/project")

# Load config from specific file
config = mixed_pickles.ValidationConfig.from_file("pyproject.toml")
config = mixed_pickles.ValidationConfig.from_file(".mixed-pickles.toml")

# Manual configuration
config = mixed_pickles.ValidationConfig(
    threshold=50,                    # Minimum message length
    require_issue_ref=False,         # Disable issue reference check
    require_conventional_format=False,
    check_vague_language=True,
    check_wip=True,
    check_imperative=True,
    branches=["main", "develop"]     # Only validate on these branches
)
mixed_pickles.analyze_commits(config=config)

# Branch filtering with glob patterns
config = mixed_pickles.ValidationConfig(
    branches=["main", "release/*", "hotfix/**"]
)
mixed_pickles.analyze_commits(config=config)

# Adjust severity levels
config = mixed_pickles.ValidationConfig()
config.set_severity(
    mixed_pickles.Validation.MissingReference,
    mixed_pickles.Severity.Error
)
config.set_severity(
    mixed_pickles.Validation.ShortCommit,
    mixed_pickles.Severity.Ignore
)
mixed_pickles.analyze_commits(config=config)

# Fetch commits for custom processing
commits = mixed_pickles.fetch_commits(limit=5)
for commit in commits:
    print(f"{commit.short_hash}: {commit.message}")

Pre-commit Hook

Add to your .pre-commit-config.yaml:

repos:
  - repo: local
    hooks:
      - id: mixed-pickles
        name: Validate commit messages
        entry: mixed-pickles
        language: python
        additional_dependencies: [mixed-pickles]
        always_run: true
        pass_filenames: false
        stages: [pre-push]

With uv, you can also run it directly:

repos:
  - repo: local
    hooks:
      - id: mixed-pickles
        name: Validate commit messages
        entry: uv run mixed-pickles
        language: system
        always_run: true
        pass_filenames: false
        stages: [pre-push]

CLI Options

Option Description
--path <PATH> Repository path (default: current directory)
--limit <N> Max commits to analyze
--threshold <N> Minimum message length (default: 30)
--branch <PATTERN> Only validate on matching branches (repeatable, supports globs)
--quiet, -q Suppress output unless issues found
--strict Treat warnings as errors
--error <LIST> Validations to treat as errors
--warn <LIST> Validations to treat as warnings
--ignore <LIST> Validations to skip reporting
--disable <LIST> Validations to disable entirely
--config <PATH> Path to configuration file
--no-config Ignore configuration file

Validation aliases for CLI: short, ref, format, vague, wip, imperative

Configuration

Configure mixed-pickles via pyproject.toml for project-specific settings:

[tool.mixed-pickles]
# Minimum commit message length (default: 30)
threshold = 50

# Only validate on specific branches (supports glob patterns)
# Empty = validate on all branches (default)
branch = ["main", "develop", "release/*"]

# Disable specific validations entirely
disable = ["reference", "format"]

# Override severity levels
[tool.mixed-pickles.severity]
wip = "error"          # Block on WIP commits (default)
short = "warning"      # Warn but allow (default)
vague = "ignore"       # Don't report
reference = "info"     # Informational only (default)

Or use a dedicated .mixed-pickles.toml file (takes precedence over pyproject.toml):

threshold = 50
branch = ["main", "develop"]
disable = ["format"]

[severity]
short = "error"

Configuration Precedence

Settings are applied in this order (later overrides earlier):

  1. Defaults - Built-in default values
  2. Config file - pyproject.toml or .mixed-pickles.toml
  3. CLI arguments - Command-line flags

Available Validations

Name Aliases Default Description
short short-commit warning Message below threshold
wip wip-commit error WIP/fixup/squash markers
reference ref, missing-reference info Missing issue reference
format invalid-format info Not conventional commits
vague vague-language warning Generic descriptions
imperative non-imperative warning Past/continuous tense

Severity Levels

  • Error: Fails the check (exit code 1)
  • Warning: Reported but passes (fails with --strict)
  • Info: Informational only
  • Ignore: Tracked but not reported

Branch Filtering

Run validations only on specific branches. Useful for CI/CD pipelines where you want strict rules on main/develop but flexibility on feature branches.

Glob Patterns

Pattern Matches Does Not Match
main main main-v2, feature/main
feature/* feature/login, feature/auth feature/user/profile
release/** release/v1, release/v1/hotfix releases/v1
*-stable v1-stable, prod-stable stable, v1-stable-2
release-? release-1, release-2 release-10

Behavior

  • Empty branch: Validates on all branches (default)
  • Detached HEAD: Validation is skipped
  • Non-matching branch: Validation is skipped (exits successfully)

Contributing

See CONTRIBUTING.md for contribution guidelines.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mixed_pickles-0.3.0.tar.gz (54.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

mixed_pickles-0.3.0-cp38-abi3-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.8+Windows x86-64

mixed_pickles-0.3.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ x86-64

mixed_pickles-0.3.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.5 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARM64

mixed_pickles-0.3.0-cp38-abi3-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

mixed_pickles-0.3.0-cp38-abi3-macosx_10_12_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

File details

Details for the file mixed_pickles-0.3.0.tar.gz.

File metadata

  • Download URL: mixed_pickles-0.3.0.tar.gz
  • Upload date:
  • Size: 54.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mixed_pickles-0.3.0.tar.gz
Algorithm Hash digest
SHA256 2c98383088adea94bd41855b10dd1b227fc00699dc7df2b98eea0441c4d34d8f
MD5 f125c0bd30943406ff6ba8c954949eb3
BLAKE2b-256 5d87e92ddfa79ae00da13ac539d927c8a9eadabf24baca8914304555a796a028

See more details on using hashes here.

File details

Details for the file mixed_pickles-0.3.0-cp38-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for mixed_pickles-0.3.0-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 dfa5458bff72ca6cd858bccf699d36ede0fb57c8c75feb52db77b03ace5267d2
MD5 0c1b52c7a3248444eb395fa575f0ec61
BLAKE2b-256 f28be143ade1fa6bbde0f9738e5f849321412d6936bd931e04abf14610a60675

See more details on using hashes here.

File details

Details for the file mixed_pickles-0.3.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mixed_pickles-0.3.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 056fa3ce5edd99084deda13f4c22628c53adce8b12dadec1da260b0297679976
MD5 a5233c8a8b070e73b53eb7aba69d482e
BLAKE2b-256 4240d4fbf79ff88a45382cd5872af6f4a9faaf491cf733c9a3ead2c73a18ef2c

See more details on using hashes here.

File details

Details for the file mixed_pickles-0.3.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for mixed_pickles-0.3.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 75cd8ad8a573e653bb5a7781ea97706fda102ecb216643258996bd12a181393a
MD5 194ad9a5e663f01325911f58361b7562
BLAKE2b-256 279d1e4fe7e4596da8a75838fb86f17f34ab93df2976ddd9f66397154eadf1d6

See more details on using hashes here.

File details

Details for the file mixed_pickles-0.3.0-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mixed_pickles-0.3.0-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 477f8552b9d2d30f150d406357e0eb0267f0974b011071f920fe8cae95311478
MD5 24baca6f7437775d3d4743fda20fcdc8
BLAKE2b-256 3127f3a8632d2fff6dd7239b648d43263337ceaf8fbc852111f9c18944491972

See more details on using hashes here.

File details

Details for the file mixed_pickles-0.3.0-cp38-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for mixed_pickles-0.3.0-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 059150fa400ebb1aceb6897df54805a87f5bcf98892a3e6acef9c12244b00ce3
MD5 51ce7834476d96588303c7b294ac50ae
BLAKE2b-256 67e8429ee85764489e74bc8b5393ad26590e42e13942481f46136367176b6d88

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page