diff --git a/freqtrade/configuration/configuration.py b/freqtrade/configuration/configuration.py index 184f9decf..d9c860abd 100644 --- a/freqtrade/configuration/configuration.py +++ b/freqtrade/configuration/configuration.py @@ -468,7 +468,7 @@ class Configuration: else: logger.info(logstring.format(config[argname])) if deprecated_msg: - warnings.warn(f"DEPRECATED: {deprecated_msg}", DeprecationWarning) + warnings.warn(f"DEPRECATED: {deprecated_msg}", DeprecationWarning, stacklevel=1) def _resolve_pairs_list(self, config: Config) -> None: """ diff --git a/pyproject.toml b/pyproject.toml index 49fdff752..bd36d15c6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -128,7 +128,7 @@ target-version = "py38" # Exclude UP036 as it's causing the "exit if < 3.9" to fail. extend-select = [ "C90", # mccabe - # "B", # bugbear + "B", # bugbear # "N", # pep8-naming "F", # pyflakes "E", # pycodestyle @@ -155,10 +155,11 @@ extend-ignore = [ "E272", # Multiple spaces before keyword "E221", # Multiple spaces before operator "B007", # Loop control variable not used + "B904", # BugBear - except raise from "S603", # `subprocess` call: check for execution of untrusted input "S607", # Starting a process with a partial executable path "S608", # Possible SQL injection vector through string-based query construction - "NPY002", # Numpy legacy random generator + "NPY002", # Numpy legacy random generator ] [tool.ruff.lint.mccabe] @@ -166,7 +167,9 @@ max-complexity = 12 [tool.ruff.lint.per-file-ignores] "freqtrade/freqai/**/*.py" = [ - "S311" # Standard pseudo-random generators are not suitable for cryptographic purposes + "S311", # Standard pseudo-random generators are not suitable for cryptographic purposes + "B006", # Bugbear - mutable default argument + "B008", # bugbear - Do not perform function calls in argument defaults ] "tests/**/*.py" = [ "S101", # allow assert in tests