Skip to content

Commit 922fbaa

Browse files
author
Shrishti Banshiar
committed
Apply black formatting fixes
1 parent 493efa9 commit 922fbaa

9 files changed

+29
-23
lines changed

.pre-commit-config.yaml

+9-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ repos:
66
verbose: True
77
exclude: ^(locales|presentation|fuzz/generated|test|cve_bin_tool/checkers|build)
88
args: ["-vv", "-i", "-I", "-M", "-C", "-n", "-p", "-f", "60.0"]
9-
# args for cut and paste: interrogate -vv -i -I -M -C -n -p -f 60.0
109

1110
- repo: https://github.com/pycqa/isort
1211
rev: 6.0.1
@@ -16,7 +15,7 @@ repos:
1615
exclude: ^fuzz/generated/
1716

1817
- repo: https://github.com/psf/black-pre-commit-mirror
19-
rev: 24.10.0
18+
rev: 25.1.0 # Kept latest revision
2019
hooks:
2120
- id: black
2221
exclude: ^fuzz/generated/
@@ -73,14 +72,21 @@ repos:
7372
doc/.*|
7473
test/test_data/.*|
7574
test/__init__.py|
76-
test/test_file.py|s
75+
test/test_file.py|
7776
test/test_requirements.py|
7877
test/test_strings.py|
7978
test/test_triage.py|
8079
test/test_version.py|
8180
test/utils.py|
8281
)$
8382
83+
- repo: https://github.com/igorshubovych/markdownlint-cli
84+
rev: v0.44.0
85+
hooks:
86+
- id: markdownlint
87+
name: Markdown Linter
88+
files: \.md$
89+
8490
- repo: https://github.com/codespell-project/codespell
8591
rev: v2.4.1
8692
hooks:

cve_bin_tool/async_utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
# SOFTWARE."
2525

2626

27-
""" Utility classes for the CVE Binary Tool """
27+
"""Utility classes for the CVE Binary Tool"""
2828

2929
from __future__ import annotations
3030

cve_bin_tool/checkers/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (C) 2021 Intel Corporation
22
# SPDX-License-Identifier: GPL-3.0-or-later
33

4-
""" CVE Checkers """
4+
"""CVE Checkers"""
55
from __future__ import annotations
66

77
import collections

cve_bin_tool/file.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -62,24 +62,24 @@ def check_fake_test(_filename: str, signature: bytes) -> bool:
6262

6363
def check_mach_o_32(_filename: str, signature: bytes) -> bool:
6464
"""Check for Mach-O 32-bit signature."""
65-
return signature[:4] == b"\xFE\xED\xFA\xCE"
65+
return signature[:4] == b"\xfe\xed\xfa\xce"
6666

6767

6868
def check_mach_o_64(_filename: str, signature: bytes) -> bool:
6969
"""Check for Mach-O 64-bit signature."""
70-
return signature[:4] == b"\xFE\xED\xFA\xCF"
70+
return signature[:4] == b"\xfe\xed\xfa\xcf"
7171

7272

7373
def check_mach_o_universal(_filename: str, signature: bytes) -> bool:
7474
"""Check for Mach-O Universal Binary signature."""
75-
return signature[:4] == b"\xCA\xFE\xBA\xBE"
75+
return signature[:4] == b"\xca\xfe\xba\xbe"
7676

7777

7878
def check_ios_arm(_filename: str, signature: bytes) -> bool:
7979
"""Check for Mach-O Universal Binary signature."""
80-
return signature[:4] == b"\xCF\xFA\xED\xFE"
80+
return signature[:4] == b"\xcf\xfa\xed\xfe"
8181

8282

8383
def check_wasm(_filename: str, signature: bytes) -> bool:
8484
"""Check for WebAssembly (WASM) signature."""
85-
return signature[:4] == b"\x00\x61\x73\x6D"
85+
return signature[:4] == b"\x00\x61\x73\x6d"

cve_bin_tool/merge.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ def get_intermediate_cve_scanner(cve_data_list, score) -> list[CVEScanner]:
228228

229229

230230
def parse_data_from_json(
231-
json_data: list[dict[str, str]]
231+
json_data: list[dict[str, str]],
232232
) -> dict[ProductInfo, TriageData]:
233233
"""Parse CVE JSON dictionary to Dict[ProductInfo, TriageData]"""
234234

test/test_executable.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ def _check_test(self, type):
3535
the given string is in the parsed result"""
3636
file_signatures = {
3737
"elf": (b"\x7f\x45\x4c\x46\x02\x01\x01\x03\n", True, ".out"),
38-
"mach_o_32": (b"\xFE\xED\xFA\xCE\x00\x00\x00\x00", True, ".out"),
39-
"mach_o_64": (b"\xFE\xED\xFA\xCF\x00\x00\x00\x00", True, ".out"),
40-
"mach_o_universal": (b"\xCA\xFE\xBA\xBE\x00\x00\x00\x00", True, ".out"),
41-
"ios_arm": (b"\xCF\xFA\xED\xFE\x00\x00\x00\x00", True, ".out"),
42-
"wasm": (b"yoyo\x00\x61\x73\x6D\x01\x00\x00\x00", True, ".out"),
38+
"mach_o_32": (b"\xfe\xed\xfa\xce\x00\x00\x00\x00", True, ".out"),
39+
"mach_o_64": (b"\xfe\xed\xfa\xcf\x00\x00\x00\x00", True, ".out"),
40+
"mach_o_universal": (b"\xca\xfe\xba\xbe\x00\x00\x00\x00", True, ".out"),
41+
"ios_arm": (b"\xcf\xfa\xed\xfe\x00\x00\x00\x00", True, ".out"),
42+
"wasm": (b"yoyo\x00\x61\x73\x6d\x01\x00\x00\x00", True, ".out"),
4343
"c": (b"#include <stdio.h>", False, ".c"),
4444
"single_byte": (b"1", False, ".txt"),
4545
"windows": (b"MZ\x90\x00", True, ".dll"),

test/test_extractor.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (C) 2022 Intel Corporation
22
# SPDX-License-Identifier: GPL-3.0-or-later
33

4-
""" CVE Binary Tool tests for the extractor function """
4+
"""CVE Binary Tool tests for the extractor function"""
55
from __future__ import annotations
66

77
import shutil

test/test_file.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ async def _check_test(self, type):
3232
the given string is in the parsed result"""
3333
file_signatures = {
3434
"elf": (b"\x7f\x45\x4c\x46\x02\x01\x01\x03\n", True, ".out"),
35-
"mach_o_32": (b"\xFE\xED\xFA\xCE\x00\x00\x00\x00", True, ".out"),
36-
"mach_o_64": (b"\xFE\xED\xFA\xCF\x00\x00\x00\x00", True, ".out"),
37-
"mach_o_universal": (b"\xCA\xFE\xBA\xBE\x00\x00\x00\x00", True, ".out"),
38-
"ios_arm": (b"\xCF\xFA\xED\xFE\x00\x00\x00\x00", True, ".out"),
39-
"wasm": (b"\x00\x61\x73\x6D\x01\x00\x00\x00", True, ".out"),
35+
"mach_o_32": (b"\xfe\xed\xfa\xce\x00\x00\x00\x00", True, ".out"),
36+
"mach_o_64": (b"\xfe\xed\xfa\xcf\x00\x00\x00\x00", True, ".out"),
37+
"mach_o_universal": (b"\xca\xfe\xba\xbe\x00\x00\x00\x00", True, ".out"),
38+
"ios_arm": (b"\xcf\xfa\xed\xfe\x00\x00\x00\x00", True, ".out"),
39+
"wasm": (b"\x00\x61\x73\x6d\x01\x00\x00\x00", True, ".out"),
4040
"c": (b"#include <stdio.h>", False, ".c"),
4141
"single_byte": (b"1", False, ".txt"),
4242
"windows": (b"MZ", True, ".txt"),

test/test_json.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (C) 2021 Intel Corporation
22
# SPDX-License-Identifier: GPL-3.0-or-later
33

4-
""" Validates the NIST data feed
4+
"""Validates the NIST data feed
55
1. Against their schema.
66
This uses the schemas mentioned here: https://nvd.nist.gov/vuln/Data-Feeds/JSON-feed-changelog
77
2. Against the provided metadata, including the sha256sum

0 commit comments

Comments
 (0)