Skip to content

Commit

Permalink
Ruff: Add and fix S105 (#11068)
Browse files Browse the repository at this point in the history
Co-authored-by: Matt Tesauro <[email protected]>
  • Loading branch information
kiblik and mtesauro authored Nov 5, 2024
1 parent eae8bad commit 1659350
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 @@ -3576,9 +3576,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", "S101", "S104", "S112", "S311",
"S2", "S5", "S7", "S101", "S104", "S105", "S112", "S311",
"FBT001", "FBT003",
"A003", "A004", "A006",
"COM",
Expand Down Expand Up @@ -99,7 +99,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 1659350

Please sign in to comment.