Skip to main content

Pre-Commit-Excludes

PyPI PyPI - Python Version PyPI - License

remove-unnecessary-excludes finds lines in your exclude list that are no longer required and removes them from the supplied .pre-commit-config.yaml. The tool checks each exclude by running the affected hook without excludes and restores changes made by a failing hook when the exclude is still required.

[!NOTE] This hook deliberately only supports simple |-separated lists of file paths in exclude fields — complex regular expressions are not supported. Each path must be on its own line in a multiline YAML block scalar; compact inline exclude patterns are not rewritten. 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.5.0.tar.gz (6.1 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.5.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pre_commit_excludes-0.5.0.tar.gz
Algorithm Hash digest
SHA256 3c71d6545e0a8f6c47cb4f599c327a2f9b3ebd26acf03c38b00c173a9c28dffe
MD5 9e6c6de0bfbae1bc9baa445af3d33c22
BLAKE2b-256 8f0c2a6386f0f6887f1fd8ef93e97e9d72c4ebeb002c62031110a9d21af60d3a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pre_commit_excludes-0.5.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.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pre_commit_excludes-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0fb4df1dae3e50eb472ddd1001089001c599064536f602127840b33d95273cbc
MD5 5de20765653f8155142c009996338c5d
BLAKE2b-256 44fefc61f874db1d2dffc963fa622d480aee445f54d993500fad4b3ab0d1ee4d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pre_commit_excludes-0.5.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

This release

0.5.0 This release

2 files

0.4.0

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