Commit 586d8e0
committed
pre-commit: Recognise piskel files via exclude_types
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-commit1 parent 1d998d7 commit 586d8e0
1 file changed
+2
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | 19 | | |
21 | 20 | | |
22 | | - | |
| 21 | + | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
26 | | - | |
27 | 25 | | |
28 | 26 | | |
29 | | - | |
| 27 | + | |
30 | 28 | | |
31 | 29 | | |
32 | 30 | | |
| |||
0 commit comments