Skip to main content

Pre-Commit-Excludes

PyPI PyPI - Python Version PyPI - License

Remove Unnecessary 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.

# 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"

Restrict Folder Excludes

restrict-folder-excludes restricts excluded folders in the .pre-commit-config.yaml exclude list from a very broad folder exclude to more fine granular excludes.

# Restrict all excluded folders for all hooks
uvx --from pre-commit-excludes restrict-folder-excludes .pre-commit-config.yaml --all

# Restrict all excluded folders for specific hooks such as typos and ruff-check and skip the tests folder for check-json
uvx --from pre-commit-excludes restrict-folder-excludes .pre-commit-config.yaml --hook typos --hook ruff-check --skip-exclude "check-json:tests"

Example for the command above

# Before
exclude: |
  (?x)^(
    foo|
    bar
  )

# After
exclude: |
  (?x)^(
    foo/a|
    foo/b|
    foo/c|
    foo/foo.txt|
    foo/README.md|
    bar/a|
    bar/bar.txt
  )

Metadata

Release files for pre-commit-excludes 0.6.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pre-commit-excludes 0.6.1
File Size Uploaded
pre_commit_excludes-0.6.1.tar.gz 7.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pre-commit-excludes 0.6.1
File Interpreter ABI Platform
pre_commit_excludes-0.6.1-py3-none-any.whl Python 3 none any Details

Total release size: 18.3 kB

Release files / pre_commit_excludes-0.6.1.tar.gz

Download URL pre_commit_excludes-0.6.1.tar.gz
Size 7.9 kB
Tags Source
SHA-256 checksum
How to use checksums
af4e7b66ee49cedaaeca657d388708e8860eb2be749b7013b15aa6593632b405
BLAKE2b-256 checksum
How to use checksums
ae6adcfe96e2ac40c4201b153c4d767d7b92811d2f19d8443cb5442b2d72f642
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 12, 2026.

Transparency log

Release files / pre_commit_excludes-0.6.1-py3-none-any.whl

Download URL pre_commit_excludes-0.6.1-py3-none-any.whl
Size 10.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fb7019b169911172756674a67ddbc04bb6e0b18c25b882d9018a0d2f860387d3
BLAKE2b-256 checksum
How to use checksums
180526a87d6ac63766a089402ba5fbdfbc2e3235e2f5e85ffd8ef4153fd09555
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 12, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.6.1 This release

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page