pre-commit: Recognise piskel files via exclude_types#1289
Merged
manuq merged 2 commits intoOct 3, 2025
Conversation
My upstream pull request was merged: - pre-commit/identify#541 The maintainer chose to edit my contribution to not add the `image` tag to piskel files: > the `image` tag was an idea that didn't really pan out so I'm just > going to remove it here Of course that's their prerogative as maintainer! Unfortunately this means that my plan from commit e92fd6d, to exclude all image files with `exclude_types: [image]`, is not going to work. Instead we have to add the `piskel` type explicitly to the list, and also any further text-based image file formats that we find in future. Add `piskel` to the exclude list. Replace the `image` type with `svg`: `svg` is the only format with that type, and since that tag will not be applied to any new formats, it's clearer to be explicit. Remove the regex branches that match piskel files by name. If you have `pre-commit` set up locally, this change will cause the hook to fail: =====> Type tag 'piskel' is not recognized. Try upgrading identify and pre-commit? If you installed `pre-commit` with `uv tool install` you can run: uv tool upgrade pre-commit
|
Play this branch at https://endlessm.github.io/threadbare/branches/endlessm/wjt/pre-commit-recognise-piskel-files-via-exclude-types. (This launches the game from the start, not directly at the change(s) in this pull request.) |
manuq
approved these changes
Oct 3, 2025
Collaborator
manuq
left a comment
There was a problem hiding this comment.
Thanks for the instructions for updating the pre-commit hook.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
My upstream pull request was merged:
The maintainer chose to edit my contribution to not add the
imagetagto piskel files:
Of course that's their prerogative as maintainer!
Unfortunately this means that my plan from commit
e92fd6d, to exclude all image files
with
exclude_types: [image], is not going to work. Instead we have toadd the
piskeltype explicitly to the list, and also any furthertext-based image file formats that we find in future.
Add
piskelto the exclude list. Replace theimagetype withsvg:svgis the only format with that type, and since that tag will not beapplied to any new formats, it's clearer to be explicit.
Remove the regex branches that match piskel files by name.
If you have
pre-commitset up locally, this change will cause the hookto fail:
If you installed
pre-commitwithuv tool installyou can run: