Skip to content

Commit

Permalink
pre-commit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cdgriffith committed Aug 8, 2024
1 parent 2a324df commit 5f3b625
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 27 deletions.
15 changes: 10 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,33 @@ repos:
exclude: ^test/resources/
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
exclude: ^test/resources/
exclude: |
(?x)^(
^test/resources/.+|
^puremagic/magic_data.json
)$
- 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.6
rev: v0.5.7
hooks:
- id: ruff

- repo: https://github.com/ambv/black
rev: 24.4.2
rev: 24.8.0
hooks:
- id: black

- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.10.0'
rev: 'v1.11.1'
hooks:
- id: mypy

- repo: https://github.com/tox-dev/pyproject-fmt
rev: 2.1.3
rev: 2.2.1
hooks:
- id: pyproject-fmt

Expand Down
34 changes: 14 additions & 20 deletions puremagic/magic_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,12 @@
["", 0, ".cl2", "", "Adaptec Easy CD/DVD Creator image file"],
["", 0, ".cl3", "", "Adaptec Easy CD/DVD Creator image file"],
["", 0, ".cl4", "", "Adaptec Easy CD/DVD Creator image file"],
["", 0, ".vba", "", "Visual Basic Script"],
["", 0, "README", "text/plain", "README File" ]


["", 0, ".vba", "", "Visual Basic Script"],
["", 0, "README", "text/plain", "README File"]
],
"multi-part": {
"7b22": [
["227d", -2, ".json", "application/json", "JSON File"]
],
"7b": [
["22", -1, ".json", "application/json", "JSON File"]
],
"7b22": [["227d", -2, ".json", "application/json", "JSON File"]],
"7b": [["22", -1, ".json", "application/json", "JSON File"]],
"464f524d": [
["494c424d", 8, ".iff", "image/x-ilbm", "IFF Interleaved Bitmap Image"],
["38535658", 8, ".iff", "audio/x-8svx", "IFF 8-Bit Sampled Voice"],
Expand Down Expand Up @@ -539,17 +533,17 @@
["4e455235", -12, ".nrg", "", "Nero Disk Image (Version 2)"]
],
"headers": [
["595556344d504547",0, ".y4m", "video/x-yuv4mpeg", "YUV4MPEG2 video file"],
["3c68746d6c", 0, ".html", "text/html", "HTML File"],
["424c5545", 0, ".bvr", "", "Blue Iris Video File"],
["2d2d2d2d2d424547494e20504b4353372d2d2d2d2d", 0, ".p7b", "", "PKCS 7 Certificate File" ],
["7b22", 0, ".json", "application/json", "JSON File"],
["7b", 0, ".json", "application/json", "JSON File"],
["50755454592d557365722d4b65792d46696c65", 0, ".ppk", "", "PuTTY User Key File"],
["595556344d504547",0, ".y4m", "video/x-yuv4mpeg", "YUV4MPEG2 video file"],
["3c68746d6c", 0, ".html", "text/html", "HTML File"],
["424c5545", 0, ".bvr", "", "Blue Iris Video File"],
["2d2d2d2d2d424547494e20504b4353372d2d2d2d2d", 0, ".p7b", "", "PKCS 7 Certificate File" ],
["7b22", 0, ".json", "application/json", "JSON File"],
["7b", 0, ".json", "application/json", "JSON File"],
["50755454592d557365722d4b65792d46696c65", 0, ".ppk", "", "PuTTY User Key File"],
["2d2d2d2d20424547494e2053534832205055424c4943204b4559202d2d2d2d", 0, "", "", "SSH Public Key"],
["2d2d2d2d424547494e", 0, "", "", "Key or Cert File"],
["2d2d2d2d20424547494e", 0, "", "", "Key or Cert File"],
["30313233343536373839", 0, ".puremagic_multi_footer", "text/ascii", "TESTFILE"],
["2d2d2d2d424547494e", 0, "", "", "Key or Cert File"],
["2d2d2d2d20424547494e", 0, "", "", "Key or Cert File"],
["30313233343536373839", 0, ".puremagic_multi_footer", "text/ascii", "TESTFILE"],
["ff0a", 0, ".jxl", "image/jxl", "JPEG XL image (Raw stream)"],
["0000000c4a584c200d0a870a", 0, ".jxl", "image/jxl", "JPEG XL image (ISOBMFF container)"],
["3c3f786d6c", 0, ".xml", "application/xml", "XML Document"],
Expand Down
3 changes: 1 addition & 2 deletions puremagic/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,7 @@ def command_line_entry(*args):
print(f"\tExtension: {result.extension}")
print(f"\tMime Type: {result.mime_type}")
print(f"\tByte Match: {result.byte_match}")
print(f"\tOffset: {result.offset}")
print("")
print(f"\tOffset: {result.offset}\n")


imghdr_bug_for_bug = { # Special cases where imghdr is probably incorrect.
Expand Down

0 comments on commit 5f3b625

Please sign in to comment.