Skip to content

Commit

Permalink
Configure isort via ruff lint
Browse files Browse the repository at this point in the history
  • Loading branch information
pamella committed May 23, 2024
1 parent a9bdf43 commit 826f4f0
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 63 deletions.
7 changes: 0 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@ repos:

- repo: local
hooks:
- id: isort
name: isort-local
entry: isort
language: python
types: [python]
exclude: .+/(settings|migrations)/.+
pass_filenames: true
- id: eslint
name: eslint-local
entry: npm run lint
Expand Down
15 changes: 15 additions & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,18 @@ target-version = "py38"
quote-style = "double"
indent-style = "space"
line-ending = "auto"

[lint.isort.sections]
django = ["django"]
drf = ["rest_framework"]

[lint.isort]
section-order = [
"future",
"standard-library",
"django",
"drf",
"third-party",
"first-party",
"local-folder",
]
1 change: 1 addition & 0 deletions manage.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""

import os
import sys

Expand Down
24 changes: 5 additions & 19 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.10
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile --output-file=requirements/dev.txt requirements/base.in requirements/dev.in requirements/quality.in
Expand All @@ -17,8 +17,6 @@ astroid==2.15.8
# requirements-detector
authlib==1.3.0
# via safety
backports-tarfile==1.1.1
# via jaraco-context
bandit==1.7.8
# via -r requirements/quality.in
build==1.2.1
Expand Down Expand Up @@ -71,13 +69,9 @@ flake8-polyfill==1.0.2
idna==3.7
# via requests
importlib-metadata==7.1.0
# via
# keyring
# twine
# via twine
isort==5.13.2
# via
# -r requirements/quality.in
# pylint
# via pylint
jaraco-classes==3.4.0
# via keyring
jaraco-context==5.3.0
Expand Down Expand Up @@ -226,6 +220,8 @@ ruamel-yaml==0.18.6
# safety-schemas
ruamel-yaml-clib==0.2.8
# via ruamel-yaml
ruff==0.4.5
# via -r requirements/quality.in
safety==3.2.0
# via -r requirements/quality.in
safety-schemas==0.0.2
Expand All @@ -248,14 +244,6 @@ stevedore==5.2.0
# via bandit
toml==0.10.2
# via requirements-detector
tomli==2.0.1
# via
# build
# dparse
# pip-tools
# pylint
# pyproject-api
# tox
tomlkit==0.12.5
# via pylint
tox==3.28.0
Expand All @@ -270,8 +258,6 @@ typer==0.12.3
# via safety
typing-extensions==4.11.0
# via
# asgiref
# astroid
# pydantic
# pydantic-core
# safety
Expand Down
8 changes: 1 addition & 7 deletions requirements/doc.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.10
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile --output-file=requirements/doc.txt requirements/base.in requirements/doc.in
Expand Down Expand Up @@ -73,11 +73,5 @@ sqlparse==0.5.0
# via django
stevedore==5.2.0
# via doc8
tomli==2.0.1
# via
# doc8
# sphinx
typing-extensions==4.11.0
# via asgiref
urllib3==2.2.1
# via requests
4 changes: 2 additions & 2 deletions requirements/quality.in
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Requirements for code quality checks

isort # to standardize order of imports
astroid
pylint # linter for python
pylint_django # pylint plugin for django
pylint_celery # pylint plugin for celery
bandit
safety
prospector
ruff # Python linter and code formatter
prospector
13 changes: 4 additions & 9 deletions requirements/quality.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.10
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile --output-file=requirements/quality.txt requirements/quality.in
Expand Down Expand Up @@ -44,9 +44,7 @@ flake8-polyfill==1.0.2
idna==3.7
# via requests
isort==5.13.2
# via
# -r requirements/quality.in
# pylint
# via pylint
jinja2==3.1.4
# via safety
lazy-object-proxy==1.10.0
Expand Down Expand Up @@ -142,6 +140,8 @@ ruamel-yaml==0.18.6
# safety-schemas
ruamel-yaml-clib==0.2.8
# via ruamel-yaml
ruff==0.4.5
# via -r requirements/quality.in
safety==3.2.0
# via -r requirements/quality.in
safety-schemas==0.0.2
Expand All @@ -158,17 +158,12 @@ stevedore==5.2.0
# via bandit
toml==0.10.2
# via requirements-detector
tomli==2.0.1
# via
# dparse
# pylint
tomlkit==0.12.5
# via pylint
typer==0.12.3
# via safety
typing-extensions==4.11.0
# via
# astroid
# pydantic
# pydantic-core
# safety
Expand Down
14 changes: 2 additions & 12 deletions requirements/test.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
#
# This file is autogenerated by pip-compile with Python 3.10
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile --output-file=requirements/test.txt requirements/base.in requirements/test.in
#
asgiref==3.8.1
# via django
coverage[toml]==7.5.1
# via
# coverage
# pytest-cov
# via pytest-cov
# via
# djangorestframework
# model-bakery
djangorestframework==3.15.1
# via -r requirements/base.in
exceptiongroup==1.2.1
# via pytest
iniconfig==2.0.0
# via pytest
model-bakery==1.18.0
Expand All @@ -36,9 +32,3 @@ pytest-django==4.8.0
# via -r requirements/test.in
sqlparse==0.5.0
# via django
tomli==2.0.1
# via
# coverage
# pytest
typing-extensions==4.11.0
# via asgiref
7 changes: 0 additions & 7 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,9 +1,2 @@
[isort]
line_length = 120
known_django = django
known_djangoapp = model_utils
known_first_party = drf_rw_serializers
sections = FUTURE,STDLIB,THIRDPARTY,DJANGO,DJANGOAPP,FIRSTPARTY,LOCALFOLDER

[wheel]
universal = 1

0 comments on commit 826f4f0

Please sign in to comment.