Skip to content

Commit

Permalink
Ruff: Add and fix S108
Browse files Browse the repository at this point in the history
  • Loading branch information
kiblik committed Nov 5, 2024
1 parent 1659350 commit e416b55
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
16 changes: 0 additions & 16 deletions dojo/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,22 +144,6 @@ def get_parameter_froms_args_kwargs(args, kwargs, parameter):
return model_or_id


def on_exception_log_kwarg(func):
def wrapper(self, *args, **kwargs):
try:
return func(self, *args, **kwargs)

except Exception:
logger.info(f"exception occured at url: {self.driver.current_url}")
logger.info(f"page source: {self.driver.page_source}")
f = open("/tmp/selenium_page_source.html", "w", encoding="utf-8")
f.writelines(self.driver.page_source)
# time.sleep(30)
raise

return wrapper


def dojo_ratelimit(key="ip", rate=None, method=UNSAFE, block=False):
def decorator(fn):
@wraps(fn)
Expand Down
3 changes: 2 additions & 1 deletion 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", "S105", "S112", "S311",
"S2", "S5", "S7", "S101", "S104", "S105", "S108", "S112", "S311",
"FBT001", "FBT003",
"A003", "A004", "A006",
"COM",
Expand Down Expand Up @@ -102,6 +102,7 @@ preview = true
[lint.per-file-ignores]
"unittests/**" = [
"S105", # hardcoded passwords in tests are fine
"S108", # tmp paths mentioned in tests are fine
]

[lint.flake8-boolean-trap]
Expand Down

0 comments on commit e416b55

Please sign in to comment.