Pre-Commit-Excludes
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 inexcludefields — 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cea59b341d26bda30fe8fae3acfaaf8a960b356e4fb9eaebfb85027fe780c943
|
|
| MD5 |
9963eeb9b26a64196bb4adf5ed8a5c4b
|
|
| BLAKE2b-256 |
bac6108ff6a6e97d9c19e2db7471fd1a9ef5f81799aae3c2d49ae938ab5b2ef7
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pre_commit_excludes-0.5.1.tar.gz -
Subject digest:
cea59b341d26bda30fe8fae3acfaaf8a960b356e4fb9eaebfb85027fe780c943 - Sigstore transparency entry: 2501358300
- Sigstore integration time:
-
Permalink:
hofbi/dev-tools@7a715929d3e2071ec23e0839cc2468adb6dde75d -
Branch / Tag:
refs/tags/pre-commit-excludes-0.5.1 - Owner: https://github.com/hofbi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pre-commit-excludes.yml@7a715929d3e2071ec23e0839cc2468adb6dde75d -
Trigger Event:
push
-
Statement type:
File details
Details for the file pre_commit_excludes-0.5.1-py3-none-any.whl.
File metadata
- Download URL: pre_commit_excludes-0.5.1-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aedaaded99990e6c2ddf136122237e9da54b56bad8b32e49b472192053a3ff78
|
|
| MD5 |
7282089809681dfbe8cf19317ba7f72c
|
|
| BLAKE2b-256 |
e4c295b680bb5fdd8e9e4ac400d218e18e3a992ec13496725c012d7732cd3118
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pre_commit_excludes-0.5.1-py3-none-any.whl -
Subject digest:
aedaaded99990e6c2ddf136122237e9da54b56bad8b32e49b472192053a3ff78 - Sigstore transparency entry: 2501358313
- Sigstore integration time:
-
Permalink:
hofbi/dev-tools@7a715929d3e2071ec23e0839cc2468adb6dde75d -
Branch / Tag:
refs/tags/pre-commit-excludes-0.5.1 - Owner: https://github.com/hofbi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pre-commit-excludes.yml@7a715929d3e2071ec23e0839cc2468adb6dde75d -
Trigger Event:
push
-
Statement type: