Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pyproject.toml: Work on the readability of ruff settings #1850

Merged
merged 6 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 3 additions & 4 deletions debug_toolbar/panels/templates/panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,9 @@ def process_context_list(self, context_layers):
# QuerySet would trigger the database: user can run the
# query from SQL Panel
elif isinstance(value, (QuerySet, RawQuerySet)):
temp_layer[key] = "<<{} of {}>>".format(
value.__class__.__name__.lower(),
value.model._meta.label,
)
temp_layer[
key
] = f"<<{value.__class__.__name__.lower()} of {value.model._meta.label}>>"
else:
token = allow_sql.set(False) # noqa: FBT003
try:
Expand Down
64 changes: 23 additions & 41 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,44 +53,28 @@ path = "debug_toolbar/__init__.py"

[tool.ruff]
extend-select = [
# pyflakes, pycodestyle
"F", "E", "W",
# mmcabe
# "C90",
# isort
"I",
# pep8-naming
# "N",
# pyupgrade
"UP",
# flake8-2020
# "YTT",
# flake8-boolean-trap
"FBT",
# flake8-bugbear
"B",
# flake8-comprehensions
"C4",
# flake8-django
"DJ",
# flake8-pie
"PIE",
# flake8-simplify
"SIM",
# flake8-gettext
"INT",
# pygrep-hooks
"PGH",
# pylint
# "PL",
# unused noqa
"RUF100",
"ASYNC", # flake8-async
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"C90", # McCabe cyclomatic complexity
"DJ", # flake8-django
"E", # pycodestyle errors
"F", # Pyflakes
"FBT", # flake8-boolean-trap
"I", # isort
"INT", # flake8-gettext
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"RUF100", # Unused noqa directive
"SIM", # flake8-simplify
"SLOT", # flake8-slots
"UP", # pyupgrade
"W", # pycodestyle warnings
]
extend-ignore = [
# Allow zip() without strict=
"B905",
# No line length errors
"E501",
"B905", # Allow zip() without strict=
"E501", # Ignore line length violations
"SIM108", # Use ternary operator instead of if-else-block
]
fix = true
show-fixes = true
Expand All @@ -100,14 +84,12 @@ target-version = "py38"
combine-as-imports = true

[tool.ruff.mccabe]
max-complexity = 15
max-complexity = 16

[tool.ruff.per-file-ignores]
"*/migrat*/*" = [
# Allow using PascalCase model names in migrations
"N806",
# Ignore the fact that migration files are invalid module names
"N999",
"N806", # Allow using PascalCase model names in migrations
"N999", # Ignore the fact that migration files are invalid module names
]

[tool.coverage.html]
Expand Down