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 7be74278cb6..9158ace8652 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 30a62e2c0c1..5defe3c9d6e 100644 --- a/ruff.toml +++ b/ruff.toml @@ -52,6 +52,7 @@ select = [ "INP", "SLOT", "PIE", + "PYI", "Q001", "Q002", "Q003", "Q004", "RSE", "TID",