diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1f15674a3e..5e3781c2a5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,8 +12,9 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.14.1 hooks: - - id: ruff + - id: ruff-check args: + - --config=backend/pyproject.toml - --fix - id: ruff-format diff --git a/backend/__init__.py b/backend/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/backend/apps/api/rest/v0/__init__.py b/backend/apps/api/rest/v0/__init__.py index 236487d5ab..35cfd9ca7f 100644 --- a/backend/apps/api/rest/v0/__init__.py +++ b/backend/apps/api/rest/v0/__init__.py @@ -5,7 +5,7 @@ from ninja.pagination import RouterPaginated from ninja.throttling import AuthRateThrottle -from apps.api.rest.auth.api_key import ApiKey as ApiKey +from apps.api.rest.auth.api_key import ApiKey from apps.api.rest.v0.chapter import router as chapter_router from apps.api.rest.v0.committee import router as committee_router from apps.api.rest.v0.event import router as event_router diff --git a/backend/pyproject.toml b/backend/pyproject.toml index 3544dfeed8..5cbfeac0c8 100644 --- a/backend/pyproject.toml +++ b/backend/pyproject.toml @@ -87,6 +87,11 @@ lint.per-file-ignores."**/__init__.py" = [ "D104", # https://docs.astral.sh/ruff/rules/undocumented-public-package/ "F401", # https://docs.astral.sh/ruff/rules/unused-import/ ] +lint.per-file-ignores."**/apps/api/rest/**/*.py" = [ + "ARG001", # https://docs.astral.sh/ruff/rules/unused-function-argument/ + "B008", # https://docs.astral.sh/ruff/rules/function-call-in-default-argument/ +] + lint.per-file-ignores."**/management/commands/*.py" = [ "D101", # https://docs.astral.sh/ruff/rules/undocumented-public-class/ "D102", # https://docs.astral.sh/ruff/rules/undocumented-public-method/ @@ -117,10 +122,9 @@ lint.per-file-ignores."**/tests/**/*.py" = [ "SLF001", # https://docs.astral.sh/ruff/rules/private-member-access/ ] -lint.per-file-ignores."apps/api/rest/**/*.py" = [ - "ARG001", # https://docs.astral.sh/ruff/rules/unused-function-argument/ - "B008", # https://docs.astral.sh/ruff/rules/function-call-in-default-argument/ -] +lint.isort.known-first-party = [ "apps", "settings" ] +lint.isort.known-third-party = [ "django" ] +lint.isort.section-order = [ "future", "standard-library", "third-party", "first-party", "local-folder" ] [tool.pytest.ini_options] DJANGO_CONFIGURATION = "Test"