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.1.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.1-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pre_commit_excludes-0.5.1.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.1.tar.gz
Algorithm Hash digest
SHA256 cea59b341d26bda30fe8fae3acfaaf8a960b356e4fb9eaebfb85027fe780c943
MD5 9963eeb9b26a64196bb4adf5ed8a5c4b
BLAKE2b-256 bac6108ff6a6e97d9c19e2db7471fd1a9ef5f81799aae3c2d49ae938ab5b2ef7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pre_commit_excludes-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 aedaaded99990e6c2ddf136122237e9da54b56bad8b32e49b472192053a3ff78
MD5 7282089809681dfbe8cf19317ba7f72c
BLAKE2b-256 e4c295b680bb5fdd8e9e4ac400d218e18e3a992ec13496725c012d7732cd3118

See more details on using hashes here.

Provenance

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

This release

0.5.1 This release

2 files

0.5.0

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