From f975b6aff9db5b3c828212c18b6db94c834b6a2a Mon Sep 17 00:00:00 2001 From: raffaella Date: Tue, 30 Jan 2024 19:10:27 +0100 Subject: [PATCH 1/4] update pre-commit-config.yaml --- .pre-commit-config.yaml | 40 ++++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d0fc83a9..1cf224d8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,34 +9,46 @@ ci: repos: - repo: https://github.com/asottile/pyupgrade - rev: v3.15.0 + rev: v2.31.0 hooks: - id: pyupgrade - args: ["--py37-plus"] + args: ["--py39-plus"] - repo: https://github.com/adamchainz/django-upgrade - rev: '1.15.0' + rev: '1.4.0' hooks: - id: django-upgrade - args: [--target-version, "2.2"] - - - repo: https://github.com/PyCQA/flake8 - rev: 6.1.0 - hooks: - - id: flake8 + args: [--target-version, "3.2"] - repo: https://github.com/asottile/yesqa - rev: v1.5.0 + rev: v1.3.0 hooks: - id: yesqa - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.1.0 hooks: - id: check-merge-conflict + - id: debug-statements - id: mixed-line-ending + - id: trailing-whitespace + + - repo: https://github.com/codespell-project/codespell + rev: v2.1.0 + hooks: + - id: codespell + + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.1.14 + hooks: + - id: ruff + args: [--fix, --exit-non-zero-on-fix] + - id: ruff-format - - repo: https://github.com/pycqa/isort - rev: 5.13.2 + - repo: https://github.com/rstcheck/rstcheck + rev: v6.2.0 hooks: - - id: isort + - id: rstcheck + additional_dependencies: + - sphinx==6.1.3 + - tomli==2.0.1 From f17246b0f438dd504e9475cf8d5ae07dae0e996f Mon Sep 17 00:00:00 2001 From: raffaella Date: Tue, 30 Jan 2024 19:11:16 +0100 Subject: [PATCH 2/4] add linter rules --- pyproject.toml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..90e2b73c --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,20 @@ +[tool.ruff] +select=[ + "E", # pycodestyle errors + "W", # pycodestyle warnings + "F", # pyflakes + "I", # isort + "C", # flake8-comprehensions + "B", # flake8-bugbear + "PLE", # pylint error + "PLR", # pylint refactor + "PLW", # pylint warning + "UP", # pyupgrade +] + +extend-ignore = [ + # TODO fix separately + "E501", # line too long + "I001", # import block unsorted + "C408", # unnecessary dict call +] From c33f18e00475d9900dfec53d9f60b03274d0cc5c Mon Sep 17 00:00:00 2001 From: raffaella Date: Tue, 30 Jan 2024 23:53:46 +0100 Subject: [PATCH 3/4] upgrade revisions --- .pre-commit-config.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1cf224d8..9010bd28 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,24 +9,24 @@ ci: repos: - repo: https://github.com/asottile/pyupgrade - rev: v2.31.0 + rev: v3.15.0 hooks: - id: pyupgrade args: ["--py39-plus"] - repo: https://github.com/adamchainz/django-upgrade - rev: '1.4.0' + rev: '1.15.0' hooks: - id: django-upgrade args: [--target-version, "3.2"] - repo: https://github.com/asottile/yesqa - rev: v1.3.0 + rev: v1.5.0 hooks: - id: yesqa - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.1.0 + rev: v4.5.0 hooks: - id: check-merge-conflict - id: debug-statements @@ -34,12 +34,12 @@ repos: - id: trailing-whitespace - repo: https://github.com/codespell-project/codespell - rev: v2.1.0 + rev: v2.2.4 hooks: - id: codespell - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.14 + rev: v0.1.15 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] From b065b60eb6e4efb1279b12b98f4060bfa8816816 Mon Sep 17 00:00:00 2001 From: raffaella Date: Wed, 31 Jan 2024 15:25:02 +0100 Subject: [PATCH 4/4] update setup.cfg to include codespell --- setup.cfg | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/setup.cfg b/setup.cfg index 130d3f26..2201b4b7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -51,3 +51,7 @@ sections = FUTURE, STDLIB, DJANGO, CMS, THIRDPARTY, FIRSTPARTY, LOCALFOLDER known_first_party = djangocms_admin_style known_cms = cms, menus known_django = django + +[codespell] +ignore-words-list = cant,statics,groupe,manuel,uptodate +skip = package-lock.json,*.js,*.js.html,*.po,./.idea/*,./.env/*,./.venv/*,./django_cms.egg-info/*,./.git,*.scss