Skip to content

Commit

Permalink
Clean newline
Browse files Browse the repository at this point in the history
  • Loading branch information
kiblik committed Apr 30, 2024
1 parent 9ebef32 commit f5bb8b3
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 16 deletions.
5 changes: 1 addition & 4 deletions dojo/api_v2/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1276,10 +1276,7 @@ def validate(self, data):
"It appears as though an endpoint with this data already "
"exists for this product."
)
raise serializers.ValidationError(
msg,
code="invalid",
)
raise serializers.ValidationError(msg, code="invalid")

# use clean data
data["protocol"] = endpoint_ins.protocol
Expand Down
5 changes: 1 addition & 4 deletions dojo/tools/coverity_api/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ def get_findings(self, file, test):

if "viewContentsV1" not in tree:
msg = "Report file is not a well-formed Coverity REST view report"
raise ValueError(
msg,
file.name,
)
raise ValueError(msg, file.name)

items = []
for issue in tree["viewContentsV1"]["rows"]:
Expand Down
4 changes: 1 addition & 3 deletions dojo/tools/npm_audit/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ def parse_json(self, json_output):
code = error["code"]
summary = error["summary"]
msg = "npm audit report contains errors: %s, %s"
raise ValueError(
msg, code, summary
)
raise ValueError(msg, code, summary)

subtree = tree.get("advisories")

Expand Down
3 changes: 1 addition & 2 deletions dojo/tools/threagile/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ def get_items(self, tree, test):
for field in self.REQUIRED_FIELDS:
if field not in item.keys():
msg = f"Invalid ThreAgile risks file, missing field {field}"
raise ValueError(
msg)
raise ValueError(msg)
severity = item.get("severity", "info").capitalize()
severity = severity if severity != "Elevated" else "High"
finding = Finding(
Expand Down
4 changes: 1 addition & 3 deletions dojo/tools/yarn_audit/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ def get_items_yarn(self, tree, test):
elif element.get("type") == "error":
error = element.get("data")
msg = "yarn audit report contains errors: %s"
raise ValueError(
msg, error
)
raise ValueError(msg, error)
return list(items.values())

def get_items_auditci(self, tree, test): # https://github.com/DefectDojo/django-DefectDojo/issues/6495
Expand Down

0 comments on commit f5bb8b3

Please sign in to comment.