diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d0fc83a9..9010bd28 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,18 +12,13 @@ repos: rev: v3.15.0 hooks: - id: pyupgrade - args: ["--py37-plus"] + args: ["--py39-plus"] - repo: https://github.com/adamchainz/django-upgrade rev: '1.15.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 @@ -34,9 +29,26 @@ repos: rev: v4.5.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.2.4 + hooks: + - id: codespell + + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.1.15 + 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 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 +] 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