chore: enable flake8-bugbear ruff rules

This commit is contained in:
Éloi Rivard 2024-11-07 11:40:52 +01:00
parent 64885cfefd
commit a012814eca
No known key found for this signature in database
GPG key ID: 7EDA204EA57DD184
3 changed files with 6 additions and 3 deletions

View file

@ -132,8 +132,10 @@ def toml_content(file_path):
with open(file_path, "rb") as fd: with open(file_path, "rb") as fd:
return tomllib.load(fd) return tomllib.load(fd)
except ImportError: except ImportError as exc:
raise Exception("toml library not installed. Cannot load configuration.") raise Exception(
"toml library not installed. Cannot load configuration."
) from exc
def setup_config(app, config=None, test_config=True, env_file=".env", env_prefix=""): def setup_config(app, config=None, test_config=True, env_file=".env", env_prefix=""):

View file

@ -264,7 +264,7 @@ class LDAPBackend(Backend):
class_filter = ( class_filter = (
"".join([f"(objectClass={oc})" for oc in model.ldap_object_class]) "".join([f"(objectClass={oc})" for oc in model.ldap_object_class])
if getattr(model, "ldap_object_class") if model.ldap_object_class
else "" else ""
) )
if class_filter: if class_filter:

View file

@ -170,6 +170,7 @@ exclude_lines = [
[tool.ruff.lint] [tool.ruff.lint]
select = [ select = [
"B", # flake8-bugbear
"E", # pycodestyle "E", # pycodestyle
"F", # pyflakes "F", # pyflakes
"I", # isort "I", # isort