diff --git a/dojo/tools/blackduck/model.py b/dojo/tools/blackduck/model.py index bcf426d61a5..b83c61efdac 100644 --- a/dojo/tools/blackduck/model.py +++ b/dojo/tools/blackduck/model.py @@ -1,9 +1,9 @@ -from collections import namedtuple +from typing import NamedTuple # this class can be updated to use @dataclass in Python 3.7 # note that all types are strings except for 'locations' which is a set of # strings -BlackduckFinding = namedtuple( +BlackduckFinding = NamedTuple( "BlackduckFinding", [ "vuln_id", diff --git a/dojo/tools/blackduck_binary_analysis/model.py b/dojo/tools/blackduck_binary_analysis/model.py index aebf473eaf0..c2a779d5ff8 100644 --- a/dojo/tools/blackduck_binary_analysis/model.py +++ b/dojo/tools/blackduck_binary_analysis/model.py @@ -1,6 +1,6 @@ -from collections import namedtuple +from typing import NamedTuple -BlackduckBinaryAnalysisFinding = namedtuple( +BlackduckBinaryAnalysisFinding = NamedTuple( "BlackduckBinaryAnalysisFinding", [ "report_name", diff --git a/dojo/tools/ort/parser.py b/dojo/tools/ort/parser.py index b2c33b0c45b..8bf0273c1bc 100644 --- a/dojo/tools/ort/parser.py +++ b/dojo/tools/ort/parser.py @@ -1,6 +1,6 @@ import hashlib import json -from collections import namedtuple +from typing import NamedTuple from dojo.models import Finding @@ -192,7 +192,7 @@ def get_item(model, test): # projects: [] # rule_violation: dict -RuleViolationModel = namedtuple( +RuleViolationModel = NamedTuple( "RuleViolationModel", ["pkg", "license_id", "projects", "rule_violation"] ) diff --git a/ruff.toml b/ruff.toml index 20593fa2390..c755df0da82 100644 --- a/ruff.toml +++ b/ruff.toml @@ -47,6 +47,7 @@ select = [ "ICN", "LOG", "SLOT", + "PYI", "PD", "PGH", "TRY004",