Skip to content

Commit bd84c97

Browse files
authored
chore: black 25.1.0 & mypy linter fixes (#5264)
* chore: blacken files for black 25.1.0 * chore: fix mypy linter error: Wrong type for epss_source. * remove extraneous test file --------- Signed-off-by: Terri Oda <[email protected]>
1 parent 7a63ef5 commit bd84c97

File tree

10 files changed

+22
-235
lines changed

10 files changed

+22
-235
lines changed

cve_bin_tool/async_utils.py

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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/data_sources/epss_source.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,15 @@
1313

1414
import aiohttp
1515

16+
from cve_bin_tool.data_sources import Data_Source
1617
from cve_bin_tool.database_defaults import DISK_LOCATION_BACKUP, DISK_LOCATION_DEFAULT
1718
from cve_bin_tool.error_handler import ErrorMode
1819
from cve_bin_tool.version import HTTP_HEADERS
1920

2021
logging.basicConfig(level=logging.DEBUG)
2122

2223

23-
class Epss_Source:
24+
class Epss_Source(Data_Source):
2425
"""Data source for downloading and storing epss data"""
2526

2627
SOURCE = "EPSS"

cve_bin_tool/file.py

Lines changed: 5 additions & 5 deletions
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

Lines changed: 1 addition & 1 deletion
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

temp_test_json2.json

Lines changed: 0 additions & 214 deletions
This file was deleted.

test/test_executable.py

Lines changed: 5 additions & 5 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 5 additions & 5 deletions
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

Lines changed: 1 addition & 1 deletion
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)