From a5dee60e9847281074f54e578ed9efcdfbc25231 Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Sun, 29 Jan 2023 13:54:51 +0100 Subject: [PATCH] Introduce ruff to cookiecutter template --- cookiecutter.json | 1 + .../.github/workflows/test.yaml | 2 + .../.idea/watcherTasks.xml | 22 +++- .../.pre-commit-config.yaml | 26 +---- {{cookiecutter.project_slug}}/pyproject.toml | 104 ++++++++++++------ .../requirements-dev.in | 3 + .../src/common/models.py | 2 - .../src/common/tests/test_admin.py | 12 +- .../src/common/views.py | 2 +- {{cookiecutter.project_slug}}/src/conftest.py | 2 +- .../context_processors.py | 2 +- .../middleware.py | 2 +- .../{{cookiecutter.project_slug}}/settings.py | 18 +-- {{cookiecutter.project_slug}}/tasks.py | 2 +- 14 files changed, 124 insertions(+), 76 deletions(-) diff --git a/cookiecutter.json b/cookiecutter.json index 4b483bc..cb9d194 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -2,6 +2,7 @@ "project_name": "My Awesome Project", "project_slug": "{{ cookiecutter.project_name.lower()|replace(' ', '_')|replace('-', '_')|replace('.', '_')|trim() }}", "python_version": "3.11.1", + "python_version_slug": "py{{ cookiecutter.python_version.split('.')[:2] | join('') }}", "_copy_without_render": [ "*.html", "*/activation*.txt" diff --git a/{{cookiecutter.project_slug}}/.github/workflows/test.yaml b/{{cookiecutter.project_slug}}/.github/workflows/test.yaml index c4ada04..9632a20 100644 --- a/{{cookiecutter.project_slug}}/.github/workflows/test.yaml +++ b/{{cookiecutter.project_slug}}/.github/workflows/test.yaml @@ -24,6 +24,8 @@ jobs: run: | pip install pip-tools pip-sync requirements.txt requirements-dev.txt + - name: Ruff + run: ruff --format=github . - name: Test run: pytest --cov=. --cov-branch --cov-report term-missing:skip-covered working-directory: ./src/ diff --git a/{{cookiecutter.project_slug}}/.idea/watcherTasks.xml b/{{cookiecutter.project_slug}}/.idea/watcherTasks.xml index 98b3257..e78ac61 100644 --- a/{{cookiecutter.project_slug}}/.idea/watcherTasks.xml +++ b/{{cookiecutter.project_slug}}/.idea/watcherTasks.xml @@ -21,7 +21,7 @@