Skip to content

Commit

Permalink
chore: Update ruff lint configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Sep 16, 2024
1 parent 12bbac9 commit 2e2350e
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 10 deletions.
2 changes: 1 addition & 1 deletion cove_project/context_processors.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.conf import settings


def from_settings(request):
def from_settings(_request):
return {
"fathom": settings.FATHOM,
}
11 changes: 3 additions & 8 deletions manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@

if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "cove_project.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc

from django.core.management import execute_from_command_line

execute_from_command_line(sys.argv)
23 changes: 22 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,28 @@ line-length = 119
target-version = "py310"

[tool.ruff.lint]
select = ["E", "C4", "F", "I", "W"]
select = ["ALL"]
ignore = [
"ANN", "C901", "COM812", "D203", "D212", "D415", "EM", "PERF203", "PLR091", "Q000",
"D1",
"PTH",
]

[tool.ruff.lint.flake8-builtins]
builtins-ignorelist = ["copyright"]

[tool.ruff.lint.flake8-unused-arguments]
ignore-variadic-names = true

[tool.ruff.lint.per-file-ignores]
"docs/*" = ["D100", "INP001"]
"{*/signals,*/views,*/migrations/*}.py" = ["ARG001"]
"{*/admin,*/routers,*/views,*/commands/*}.py" = ["ARG002"]
"{*/admin,*/forms,*/models,*/routers,*/serializers,*/translation,*/migrations/*,tests/*}.py" = ["RUF012"]
"*/migrations/*" = ["E501"]
"tests/*" = [
"D", "FBT003", "INP001", "PLR2004", "PT", "S", "TRY003",
]

[tool.pytest.ini_options]
DJANGO_SETTINGS_MODULE = 'cove_project.settings'

0 comments on commit 2e2350e

Please sign in to comment.