Skip to content

Commit

Permalink
chore: update pre-commit and fix linter errors (#3308)
Browse files Browse the repository at this point in the history
* Update .pre-commit-config.yaml

* fix flake8 errors
  • Loading branch information
metabiswadeep authored Sep 4, 2023
1 parent 71f59ec commit 19fd0e8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ repos:
- id: isort

- repo: https://github.com/python/black
rev: 23.3.0
rev: 23.7.0
hooks:
- id: black

- repo: https://github.com/asottile/pyupgrade
rev: v3.7.0
rev: v3.10.1
hooks:
- id: pyupgrade
args: ["--py38-plus"]

- repo: https://github.com/pycqa/flake8
rev: 6.0.0
rev: 6.1.0
hooks:
- id: flake8
exclude: ^fuzz/generated/
Expand Down
2 changes: 1 addition & 1 deletion cve_bin_tool/cvedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ def get_vendor_product_pairs(self, package_names) -> list[dict[str, str]]:
"""

# For python package checkers we don't need the progress bar running
if type(package_names) != list:
if type(package_names) is not list:
cursor.execute(query, [package_names])
vendors = list(map(lambda x: x[0], cursor.fetchall()))

Expand Down
10 changes: 5 additions & 5 deletions test/test_checkers.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ class MyChecker(Checker):
VENDOR_PRODUCT = [("myvendor", "myproduct")]
IGNORE_PATTERNS = [r"ignore"]

assert type(MyChecker.CONTAINS_PATTERNS[0]) == Pattern
assert type(MyChecker.VERSION_PATTERNS[0]) == Pattern
assert type(MyChecker.FILENAME_PATTERNS[0]) == Pattern
assert type(MyChecker.VENDOR_PRODUCT[0]) == VendorProductPair
assert type(MyChecker.IGNORE_PATTERNS[0]) == Pattern
assert type(MyChecker.CONTAINS_PATTERNS[0]) is Pattern
assert type(MyChecker.VERSION_PATTERNS[0]) is Pattern
assert type(MyChecker.FILENAME_PATTERNS[0]) is Pattern
assert type(MyChecker.VENDOR_PRODUCT[0]) is VendorProductPair
assert type(MyChecker.IGNORE_PATTERNS[0]) is Pattern

def test_no_vpkg(self):
with pytest.raises(AssertionError) as e:
Expand Down

0 comments on commit 19fd0e8

Please sign in to comment.