Skip to content

Commit

Permalink
Ruff: Add and fix S105
Browse files Browse the repository at this point in the history
  • Loading branch information
kiblik committed Oct 14, 2024
1 parent 0bc4879 commit a3ad7d0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions dojo/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3568,9 +3568,9 @@ class Check_List(models.Model):

@staticmethod
def get_status(pass_fail):
if pass_fail == "Pass":
if pass_fail == "Pass": # noqa: S105
return "success"
if pass_fail == "Fail":
if pass_fail == "Fail": # noqa: S105
return "danger"
return "warning"

Expand Down
2 changes: 1 addition & 1 deletion dojo/tools/trivy/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
SECRET_DESCRIPTION_TEMPLATE = """{title}
**Category:** {category}
**Match:** {match}
"""
""" # noqa: S105

LICENSE_DESCRIPTION_TEMPLATE = """{title}
**Category:** {category}
Expand Down
2 changes: 1 addition & 1 deletion dojo/tools/trivy_operator/secrets_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
SECRET_DESCRIPTION_TEMPLATE = """{title}
**Category:** {category}
**Match:** {match}
"""
""" # noqa: S105


class TrivySecretsHandler:
Expand Down
7 changes: 5 additions & 2 deletions ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ select = [
"UP",
"YTT",
"ASYNC",
"S2", "S5", "S7",
"S105", "S2", "S5", "S7",
"FBT001", "FBT003",
"A003", "A004", "A006",
"COM",
Expand Down Expand Up @@ -100,7 +100,10 @@ fixable = ["ALL"]
unfixable = []
preview = true

per-file-ignores = {}
[lint.per-file-ignores]
"unittests/**" = [
"S105", # hardcoded passwords in tests are fine
]

[lint.flake8-boolean-trap]
extend-allowed-calls = ["dojo.utils.get_system_setting"]
Expand Down

0 comments on commit a3ad7d0

Please sign in to comment.