Skip to content

Commit 586d8e0

Browse files
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-commit
1 parent 1d998d7 commit 586d8e0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,15 @@ repos:
1616
- id: end-of-file-fixer
1717
exclude: |
1818
(?x)(
19-
\.piskel$|
2019
^scenes/quests/story_quests/(?!stella/|NO_EDIT/)
2120
)
22-
exclude_types: [image]
21+
exclude_types: [svg, piskel]
2322
- id: trailing-whitespace
2423
exclude: |
2524
(?x)(
26-
\.piskel$|
2725
^scenes/quests/story_quests/(?!stella/|NO_EDIT/)
2826
)
29-
exclude_types: [image]
27+
exclude_types: [svg, piskel]
3028

3129
- repo: https://github.com/editorconfig-checker/editorconfig-checker
3230
rev: v3.4.0

0 commit comments

Comments
 (0)