From 31dbfb66613e74dfd9440650953981b0881bcd28 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 17 Apr 2025 23:07:23 +0300 Subject: [PATCH] feat: Add ruff linter - Add `ruff.toml` config. - Include ruff in dev dependencies - Sort dependencies alphabetically in the dependency files. --- requirements/dev.txt | 5 +++-- requirements/prod.txt | 2 +- ruff.toml | 26 ++++++++++++++++++++++++++ 3 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 ruff.toml diff --git a/requirements/dev.txt b/requirements/dev.txt index 78390ae..8be14f0 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -2,5 +2,6 @@ -r test.txt black==24.8.0 flake8==7.1.1 -sort-requirements==1.3.0 -isort==5.13.2 \ No newline at end of file +isort==5.13.2 +ruff==0.11.5 +sort-requirements==1.3.0 \ No newline at end of file diff --git a/requirements/prod.txt b/requirements/prod.txt index c6ca034..1a04882 100644 --- a/requirements/prod.txt +++ b/requirements/prod.txt @@ -2,6 +2,6 @@ django==5.2 djangorestframework==3.15.2 djangorestframework-simplejwt==5.4.0 gunicorn==23.0.0 +psycopg2-binary==2.9.10 pycountry==24.6.1 python-dotenv==1.0.1 -psycopg2-binary==2.9.10 diff --git a/ruff.toml b/ruff.toml new file mode 100644 index 0000000..fad008f --- /dev/null +++ b/ruff.toml @@ -0,0 +1,26 @@ +line-length = 79 +exclude = ["migrations", "venv"] + + +[lint] +select = ["N", "F", "W", "E", "I", "Q", "TID", "COM", "C4", "ERA", "RET", "PTH", "ISC", "C90", "T20", "SIM"] + + +[format] +quote-style = "single" +indent-style = "space" +skip-magic-trailing-comma = false +line-ending = "auto" + + +[lint.isort] +force-sort-within-sections = true +known-first-party = ["promo_code", "user", "core", "business"] + + +[lint.flake8-quotes] +inline-quotes = "single" + + +[lint.flake8-tidy-imports] +ban-relative-imports = "all"