Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔧 Update pre-commit config #51

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 101 additions & 0 deletions .pre-commit-config-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-toml
- id: check-yaml
files: \.yaml$
- id: trailing-whitespace
exclude: (migrations/|tests/|docs/|static/|media/).*
- id: end-of-file-fixer
exclude: (migrations/|tests/|docs/|static/|media/).*
- id: check-added-large-files
exclude: (migrations/|tests/|docs/|static/|media/).*
- id: check-case-conflict
exclude: (migrations/|tests/|docs/|static/|media/).*
- id: check-merge-conflict
exclude: (migrations/|tests/|docs/|static/|media/).*
- id: check-docstring-first
exclude: (migrations/|tests/|docs/|static/|media/).*

- repo: https://github.com/tox-dev/pyproject-fmt
rev: 2.2.1
hooks:
- id: pyproject-fmt

- repo: https://github.com/tox-dev/tox-ini-fmt
rev: 1.3.1
hooks:
- id: tox-ini-fmt

- repo: https://github.com/asottile/pyupgrade
rev: v3.15.2
hooks:
- id: pyupgrade

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.5.5
hooks:
- id: ruff
args: ["--config=pyproject.toml"]
exclude: (migrations/|tests/|docs/|static/|media/|apps.py).*

- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.10.1
hooks:
- id: isort
exclude: (migrations/|tests/|docs/|static/|media/).*

- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
args: [ "--config=pyproject.toml" ]
exclude: (migrations/|tests/|docs/|static/|media/).*

- repo: https://github.com/commitizen-tools/commitizen
rev: v3.28.0
hooks:
- id: commitizen

- repo: https://github.com/PyCQA/bandit
rev: 1.7.4
hooks:
- id: bandit
args: [ "-c", "pyproject.toml", "-r", "." ]
additional_dependencies: [ "bandit[toml]" ]
exclude: (migrations/|tests/|docs/|static/|media/).*

- repo: https://github.com/PyCQA/docformatter
rev: v1.7.5
hooks:
- id: docformatter
args: [ "--in-place", "--recursive", "--blank" ]
exclude: (migrations/|tests/|docs/|static/|media/).*

- repo: https://github.com/adamchainz/blacken-docs
rev: 1.18.0
hooks:
- id: blacken-docs
additional_dependencies:
- black==24.4.2
files: '\.rst$'

- repo: https://github.com/rstcheck/rstcheck
rev: "v6.2.4"
hooks:
- id: rstcheck
args: [ "--report-level=warning" ]
files: ^(docs/(.*/)*.*\.rst)
additional_dependencies: [ Sphinx==6.2.1 ]

- repo: local
hooks:
- id: pytest
name: Pytest
entry: poetry run pytest -v
language: system
types: [ python ]
stages: [ commit ]
pass_filenames: false
always_run: true
58 changes: 57 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-toml
- id: check-yaml
files: \.yaml$
- id: trailing-whitespace
exclude: (migrations/|tests/|docs/|static/|media/).*
- id: end-of-file-fixer
Expand All @@ -15,6 +18,28 @@ repos:
- id: check-docstring-first
exclude: (migrations/|tests/|docs/|static/|media/).*

- repo: https://github.com/tox-dev/pyproject-fmt
rev: 2.2.1
hooks:
- id: pyproject-fmt

- repo: https://github.com/tox-dev/tox-ini-fmt
rev: 1.3.1
hooks:
- id: tox-ini-fmt

- repo: https://github.com/asottile/pyupgrade
rev: v3.17.0
hooks:
- id: pyupgrade

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.5.5
hooks:
- id: ruff
args: ["--config=pyproject.toml"]
exclude: (migrations/|tests/|docs/|static/|media/|apps.py).*

- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.10.1
hooks:
Expand All @@ -39,7 +64,6 @@ repos:
rev: v3.28.0
hooks:
- id: commitizen
exclude: (migrations/|tests/|docs/|static/|media/).*

- repo: https://github.com/PyCQA/bandit
rev: 1.7.4
Expand All @@ -49,6 +73,29 @@ repos:
additional_dependencies: [ "bandit[toml]" ]
exclude: (migrations/|tests/|docs/|static/|media/).*

- repo: https://github.com/PyCQA/docformatter
rev: v1.7.5
hooks:
- id: docformatter
args: ["--in-place", "--recursive", "--blank"]
exclude: (migrations/|tests/|docs/|static/|media/).*

- repo: https://github.com/adamchainz/blacken-docs
rev: 1.18.0
hooks:
- id: blacken-docs
additional_dependencies:
- black==24.4.2
files: '\.rst$'

- repo: https://github.com/rstcheck/rstcheck
rev: "v6.2.4"
hooks:
- id: rstcheck
args: ["--report-level=warning"]
files: ^(docs/(.*/)*.*\.rst)
additional_dependencies: [Sphinx==6.2.1]

- repo: https://github.com/codespell-project/codespell
# Configuration for codespell is in .codespellrc
rev: v2.2.6
Expand All @@ -58,6 +105,15 @@ repos:

- repo: local
hooks:
- id: pytest
name: Pytest
entry: poetry run pytest -v
language: system
types: [python]
stages: [commit]
pass_filenames: false
always_run: true

- id: pylint
name: pylint
entry: pylint
Expand Down
Loading