Skip to content

Commit

Permalink
ci: Pre commit checks (#517)
Browse files Browse the repository at this point in the history
  • Loading branch information
raffaellasuardini authored Jan 31, 2024
1 parent cfc0747 commit e1a55f8
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 10 deletions.
32 changes: 22 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
20 changes: 20 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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
]
4 changes: 4 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit e1a55f8

Please sign in to comment.