Skip to content

Commit 5d8975c

Browse files
Merge pull request #27 from RandomProgramm3r/ci
сhore(lint): migrate linting from flake8/isort/black to ruff - Remove config files: .flake8, .isort.cfg, pyproject.toml - Uninstall dependencies: black, flake8, isort, requirements\flake8-plugins.txt - Add ruff check call to CI
2 parents ff5e19b + 14bd97e commit 5d8975c

File tree

8 files changed

+9
-60
lines changed

8 files changed

+9
-60
lines changed

.flake8

Lines changed: 0 additions & 10 deletions
This file was deleted.

.github/workflows/linting.yml

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,17 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
python-version: ["3.12"]
14+
python-version: ["3.13"]
1515
steps:
16-
- uses: actions/checkout@v2
16+
- name: Checkout repository
17+
uses: actions/checkout@v3
1718

1819
- name: Set up Python ${{ matrix.python-version }}
19-
uses: actions/setup-python@v2
20+
uses: actions/setup-python@v4
2021
with:
2122
python-version: ${{ matrix.python-version }}
2223

23-
- name: Cache pip
24-
uses: actions/cache@v3
24+
- name: Run Ruff via Action
25+
uses: astral-sh/ruff-action@v3.2.2
2526
with:
26-
path: ~/.cache/pip
27-
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/dev.txt') }}
28-
restore-keys: |
29-
${{ runner.os }}-pip-
30-
31-
- name: Install dependencies
32-
run: |
33-
python -m pip install --upgrade pip
34-
pip install -r requirements/dev.txt
35-
36-
- name: Run linters
37-
run: |
38-
black . --check --verbose
39-
isort . --check --verbose
40-
flake8 . --count --show-source --statistics
27+
github-token: ${{ secrets.GITHUB_TOKEN }}

.isort.cfg

Lines changed: 0 additions & 7 deletions
This file was deleted.

promo_code/user/validators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def __call__(self, value):
8282

8383
if missing_fields:
8484
raise rest_framework.serializers.ValidationError(
85-
{field: 'This field is required.' for field in missing_fields},
85+
dict.fromkeys(missing_fields, 'This field is required.'),
8686
)
8787

8888
serializer = self.__class__(data=value)

pyproject.toml

Lines changed: 0 additions & 5 deletions
This file was deleted.

requirements/dev.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
-r prod.txt
22
-r test.txt
3-
black==24.8.0
4-
flake8==7.1.1
5-
isort==5.13.2
63
ruff==0.11.5
7-
sort-requirements==1.3.0
4+
sort-requirements==1.3.0

requirements/flake8-plugins.txt

Lines changed: 0 additions & 12 deletions
This file was deleted.

requirements/test.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
-r flake8-plugins.txt
21
django-debug-toolbar==4.4.6
32
parameterized==0.9.0

0 commit comments

Comments
 (0)