Skip to content

Commit f11e28f

Browse files
🎉 resolve todo in ort parser (#12082)
1 parent fe4a9e9 commit f11e28f

1 file changed

Lines changed: 6 additions & 12 deletions

File tree

dojo/tools/ort/parser.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import hashlib
22
import json
3-
from collections import namedtuple
3+
from typing import NamedTuple
44

55
from dojo.models import Finding
66

@@ -175,17 +175,11 @@ def get_item(model, test):
175175
)
176176

177177

178-
# TODO: with python 3.7
179-
# @dataclass
180-
# class RuleViolationModel:
181-
# pkg: dict
182-
# license_id: str
183-
# projects: []
184-
# rule_violation: dict
185-
186-
RuleViolationModel = namedtuple(
187-
"RuleViolationModel", ["pkg", "license_id", "projects", "rule_violation"],
188-
)
178+
class RuleViolationModel(NamedTuple):
179+
pkg: dict
180+
license_id: str
181+
projects: []
182+
rule_violation: dict
189183

190184

191185
def get_severity(rule_violation):

0 commit comments

Comments
 (0)