Skip to main content

Pre-Commit-Excludes

PyPI PyPI - Python Version PyPI - License

remove-unnecessary-excludes should help you to find lines in your exclude list that are no longer required. Running this tool will try to remove excludes from your config by removing a line, running the hook, and restore the old config if it is still required.

Right now this is in early development, so we don't automatically update the .pre-commit-config.yaml with all unnecessary excludes removed. Instead, we only print which excludes can be removed for which hook. More automation will come in future releases.

[!NOTE] This hook deliberately only supports simple |-separated lists of file paths in exclude fields — complex regular expressions are not supported. Keeping exclusions as plain |-separated paths also makes it easier for humans to maintain an overview of what is excluded.

Usage

# Cleanup the entire config for all hooks
uvx --from pre-commit-excludes remove-unnecessary-excludes .pre-commit-config.yaml --pre-commit-binary prek --git-binary git --all

# Cleanup only specific hooks such as typos and ruff-check
uvx --from pre-commit-excludes remove-unnecessary-excludes .pre-commit-config.yaml --pre-commit-binary prek --git-binary git --hook typos --hook ruff-check

# Skip excludes that you want to keep
uvx --from pre-commit-excludes remove-unnecessary-excludes .pre-commit-config.yaml --pre-commit-binary prek --git-binary git --all --skip-exclude "check-json:tests/invalid.json"

Download files

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

Source Distribution

pre_commit_excludes-0.4.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

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

pre_commit_excludes-0.4.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file pre_commit_excludes-0.4.0.tar.gz.

File metadata

  • Download URL: pre_commit_excludes-0.4.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for pre_commit_excludes-0.4.0.tar.gz
Algorithm Hash digest
SHA256 9e9c7b62ab0e5db665d27578c72839429d18107282423e2b8ce33f8eb8af797f
MD5 ca6d74f187b2f823a25975cfd2c811ef
BLAKE2b-256 ce96c328090f14288faa299c3a56c0eab27ba3ab994b5b4f8917c97fe8a547da

See more details on using hashes here.

Provenance

The following attestation bundles were made for pre_commit_excludes-0.4.0.tar.gz:

Publisher: publish-pre-commit-excludes.yml on hofbi/dev-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pre_commit_excludes-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pre_commit_excludes-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4a9cfe9cfde66c1a2afac390a0709d511ed8c8fade0fa33ae417b49a66ace6b8
MD5 fe5cab5829de114c9ec80ff2ca1c81ea
BLAKE2b-256 f8506b7f3c2c874127e12ba7dcb3132c9b286340b35e12ba3e201a26332056c6

See more details on using hashes here.

Provenance

The following attestation bundles were made for pre_commit_excludes-0.4.0-py3-none-any.whl:

Publisher: publish-pre-commit-excludes.yml on hofbi/dev-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.5.1

2 files

0.5.0

2 files

This release

0.4.0 This release

2 files

0.3.0

2 files

0.2.0

2 files

Supported by

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