forked from Github-Mirrors/canaille
chore: enable flake8-bugbear ruff rules
This commit is contained in:
parent
64885cfefd
commit
a012814eca
3 changed files with 6 additions and 3 deletions
|
@ -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=""):
|
||||||
|
|
|
@ -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:
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue