diff --git a/.flake8 b/.flake8 deleted file mode 100644 index 2a6fa7d..0000000 --- a/.flake8 +++ /dev/null @@ -1,10 +0,0 @@ -[flake8] -max-line-length = 79 -application_import_names = promo_code, user, core, business -import-order-style = google -exclude = */migrations/, venv/, verdict.py, .venv/, env/, venv, .git, __pycache__ -max-complexity = 10 -max-expression-complexity = 7 - -[flake8-quotes] -quote-style = single \ No newline at end of file diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index d5221cb..56bbcb2 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -11,30 +11,17 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.12"] + python-version: ["3.13"] steps: - - uses: actions/checkout@v2 + - name: Checkout repository + uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Cache pip - uses: actions/cache@v3 + - name: Run Ruff via Action + uses: astral-sh/ruff-action@v3.2.2 with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('requirements/dev.txt') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements/dev.txt - - - name: Run linters - run: | - black . --check --verbose - isort . --check --verbose - flake8 . --count --show-source --statistics + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.isort.cfg b/.isort.cfg deleted file mode 100644 index 0f5f77b..0000000 --- a/.isort.cfg +++ /dev/null @@ -1,7 +0,0 @@ -[settings] -profile = black -skip = migrations, venv/, venv -known_first_party = promo_code, user, core, business -default_section = THIRDPARTY -force_sort_within_sections = true -line_length = 79 \ No newline at end of file diff --git a/promo_code/user/validators.py b/promo_code/user/validators.py index bc0a0eb..2a62b5e 100644 --- a/promo_code/user/validators.py +++ b/promo_code/user/validators.py @@ -82,7 +82,7 @@ def __call__(self, value): if missing_fields: raise rest_framework.serializers.ValidationError( - {field: 'This field is required.' for field in missing_fields}, + dict.fromkeys(missing_fields, 'This field is required.'), ) serializer = self.__class__(data=value) diff --git a/pyproject.toml b/pyproject.toml deleted file mode 100644 index f86b994..0000000 --- a/pyproject.toml +++ /dev/null @@ -1,5 +0,0 @@ -[tool.black] -line-length = 79 -skip-string-normalization = true -target-version = ['py313'] -exclude = ".venv" \ No newline at end of file diff --git a/requirements/dev.txt b/requirements/dev.txt index 8be14f0..a5331ab 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -1,7 +1,4 @@ -r prod.txt -r test.txt -black==24.8.0 -flake8==7.1.1 -isort==5.13.2 ruff==0.11.5 -sort-requirements==1.3.0 \ No newline at end of file +sort-requirements==1.3.0 diff --git a/requirements/flake8-plugins.txt b/requirements/flake8-plugins.txt deleted file mode 100644 index 5f4d517..0000000 --- a/requirements/flake8-plugins.txt +++ /dev/null @@ -1,12 +0,0 @@ -flake8-absolute-import==1.0.0.2 -flake8-bugbear==24.8.19 -flake8-clean-block==0.1.2 -flake8-commas==4.0.0 -flake8-eradicate==1.5.0 -flake8-expression-complexity==0.0.11 -flake8-implicit-str-concat==0.5.0 -flake8-print==5.0.0 -flake8-quotes==3.4.0 -flake8-return==1.2.0 -flake8-use-pathlib==0.3.0 -pep8-naming==0.14.1 \ No newline at end of file diff --git a/requirements/test.txt b/requirements/test.txt index 49553db..62a33be 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -1,3 +1,2 @@ --r flake8-plugins.txt django-debug-toolbar==4.4.6 parameterized==0.9.0