Skip to content

Commit

Permalink
Add ruff linter to pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
cclauss committed May 22, 2024
1 parent 5608e1b commit 3f09035
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 18 deletions.
15 changes: 11 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
# Identify invalid files
- id: check-ast
Expand All @@ -17,7 +17,6 @@ repos:
- id: check-docstring-first
- id: debug-statements
- id: requirements-txt-fixer
- id: fix-encoding-pragma
- id: fix-byte-order-marker
# General quality checks
- id: mixed-line-ending
Expand All @@ -29,12 +28,20 @@ repos:
- id: check-executables-have-shebangs
- id: end-of-file-fixer
exclude: ^test/resources/.+

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.4
hooks:
- id: ruff
args: [--extend-ignore, "F401,F403"]

- repo: https://github.com/ambv/black
rev: 24.1.1
rev: 24.4.2
hooks:
- id: black
args: [--config=.black.toml]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.8.0'
rev: 'v1.10.0'
hooks:
- id: mypy
28 changes: 14 additions & 14 deletions puremagic/magic_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -387,13 +387,13 @@
["00010002", 2, ".rgb", "image/x-rgb", "Silicon Graphics RGB Bitmap (Uncompressed, 1bpc, 2D Image)"],
["01010002", 2, ".rgb", "image/x-rgb", "Silicon Graphics RGB Bitmap (RLE compressed, 1bpc, 2D Image)"],
["00020002", 2, ".rgb", "image/x-rgb", "Silicon Graphics RGB Bitmap (Uncompressed, 2bpc, 2D Image)"],
["01020002", 2, ".rgb", "image/x-rgb", "Silicon Graphics RGB Bitmap (RLE compressed, 2bpc, Multiple 2D Images)"],
["01020002", 2, ".rgb", "image/x-rgb", "Silicon Graphics RGB Bitmap (RLE compressed, 2bpc, Multiple 2D Images)"],
["00010003", 2, ".rgb", "image/x-rgb", "Silicon Graphics RGB Bitmap (Uncompressed, 1bpc, Multiple 2D Images)"],
["01010003", 2, ".rgb", "image/x-rgb", "Silicon Graphics RGB Bitmap (RLE compressed, 1bpc, Multiple 2D Images)"],
["00020003", 2, ".rgb", "image/x-rgb", "Silicon Graphics RGB Bitmap (Uncompressed, 2bpc, Multiple 2D Images)"],
["01020003", 2, ".rgb", "image/x-rgb", "Silicon Graphics RGB Bitmap (RLE compressed, 2bpc, Multiple 2D Images)"]
],
"59a66a95" : [
"59a66a95" : [
["00000000", 22, ".sun", "image/x-sun-raster", "Sun raster image (Old, No color map)"],
["00010000", 22, ".sun", "image/x-sun-raster", "Sun raster image (Standard, No color map)"],
["00020000", 22, ".sun", "image/x-sun-raster", "Sun raster image (Byte-Encoded, No color map)"],
Expand All @@ -415,7 +415,7 @@
["00040002", 22, ".sun", "image/x-sun-raster", "Sun raster image (TIFF format, RAW color map)"],
["00050002", 22, ".sun", "image/x-sun-raster", "Sun raster image (IFF format, RAW color map)"],
["FFFF0002", 22, ".sun", "image/x-sun-raster", "Sun raster image (Experimental, RAW color map)"]
],
],
"716f6966" : [
["0300", 12, ".qoi", "", "Quite OK image (RGB, sRGB with linear alpha)"],
["0301", 12, ".qoi", "", "Quite OK image (RGB, All channels alpha)"],
Expand All @@ -431,7 +431,7 @@
["0a23", 2, ".pbm", "image/x-portable-bitmap", "PBM image (Ascii)"],
["0d23", 2, ".pbm", "image/x-portable-bitmap", "PBM image (Ascii)"],
["0923", 2, ".pbm", "image/x-portable-bitmap", "PBM image (Ascii)"]
],
],
"5034" : [
["20", 2, ".pbm", "image/x-portable-bitmap", "PBM image (Binary)"],
["0a", 2, ".pbm", "image/x-portable-bitmap", "PBM image (Binary)"],
Expand All @@ -441,7 +441,7 @@
["0a23", 2, ".pbm", "image/x-portable-bitmap", "PBM image (Binary)"],
["0d23", 2, ".pbm", "image/x-portable-bitmap", "PBM image (Binary)"],
["0923", 2, ".pbm", "image/x-portable-bitmap", "PBM image (Binary)"]
],
],
"5032" : [
["20", 2, ".pgm", "image/x-portable-graymap", "PGM image (Ascii)"],
["0a", 2, ".pgm", "image/x-portable-graymap", "PGM image (Ascii)"],
Expand All @@ -451,7 +451,7 @@
["0a23", 2, ".pgm", "image/x-portable-graymap", "PGM image (Ascii)"],
["0d23", 2, ".pgm", "image/x-portable-graymap", "PGM image (Ascii)"],
["0923", 2, ".pgm", "image/x-portable-graymap", "PGM image (Ascii)"]
],
],
"5035" : [
["20", 2, ".pgm", "image/x-portable-graymap", "PGM image (Binary)"],
["0a", 2, ".pgm", "image/x-portable-graymap", "PGM image (Binary)"],
Expand All @@ -471,7 +471,7 @@
["0a23", 2, ".ppm", "image/x-portable-pixmap", "PPM image (Ascii)"],
["0d23", 2, ".ppm", "image/x-portable-pixmap", "PPM image (Ascii)"],
["0923", 2, ".ppm", "image/x-portable-pixmap", "PPM image (Ascii)"]
],
],
"5036" : [
["20", 2, ".ppm", "image/x-portable-pixmap", "PPM image (Binary)"],
["0a", 2, ".ppm", "image/x-portable-pixmap", "PPM image (Binary)"],
Expand All @@ -484,24 +484,24 @@
],
"5046" : [
["0a", 2, ".pfm", "", "Portable Float Map (Colour)"],
["0d", 2, ".pbm", "", "Portable Float Map (Colour)"]
["0d", 2, ".pbm", "", "Portable Float Map (Colour)"]
],
"5066" : [
["0a", 2, ".pfm", "", "Portable Float Map (Greyscale)"],
["0d", 2, ".pfm", "", "Portable Float Map (Greyscale)"]
],
["0d", 2, ".pfm", "", "Portable Float Map (Greyscale)"]
],
"504634" : [
["0a", 3, ".pfm", "", "Augmented Portable Float Map"],
["0d", 3, ".pfm", "", "Augmented Portable Float Map"]
],
["0d", 3, ".pfm", "", "Augmented Portable Float Map"]
],
"5037" : [
["0a", 2, ".pam", "image/x-portable-arbitrarymap", "Portable Arbitrary Map"],
["0d", 2, ".pam", "image/x-portable-arbitrarymap", "Portable Arbitrary Map"],
["0a5749445448", 2, ".pam", "image/x-portable-arbitrarymap", "Portable Arbitrary Map"],
["0d5749445448", 2, ".pam", "image/x-portable-arbitrarymap", "Portable Arbitrary Map"],
["0a484549474854", 2, ".pam", "image/x-portable-arbitrarymap", "Portable Arbitrary Map"],
["0d484549474854", 2, ".pam", "image/x-portable-arbitrarymap", "Portable Arbitrary Map"]
]
["0d484549474854", 2, ".pam", "image/x-portable-arbitrarymap", "Portable Arbitrary Map"]
]
},
"footers": [
["54525545564953494f4e2d5846494c452e00", -18, ".tga", "image/tga", "Truevision Targa Graphic file"],
Expand Down

0 comments on commit 3f09035

Please sign in to comment.