From 26c861803caf45e65a51530deeb9d3f49ece39ab Mon Sep 17 00:00:00 2001 From: ARYAN-NIKNEZHAD Date: Thu, 29 Aug 2024 14:04:27 +0430 Subject: [PATCH] :wrench: chore: Update pre-commit config - Add bandit for security check in python code - Add pylint&pytest in local - Add commitizen hook - Update other hooks --- .pre-commit-config.yaml | 44 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e03af4f..e8842c2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,16 +25,58 @@ repos: rev: 23.3.0 hooks: - id: black + args: ["--config=pyproject.toml"] exclude: (migrations/|tests/|docs/|static/|media/).* - language_version: python3.11 - 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/).* - repo: https://github.com/PyCQA/docformatter rev: v1.7.5 hooks: - id: docformatter args: ["--in-place", "--recursive", "--blank"] + + - repo: https://github.com/commitizen-tools/commitizen + rev: v3.28.0 + hooks: + - id: commitizen + exclude: (migrations/|tests/|docs/|static/|media/).* + + - 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: 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 + language: system + types: [python] + require_serial: true + args: + - "-rn" + - "-sn" + - "--rcfile=pyproject.toml" + files: ^sage_qrcode/ + +ci: + skip: [pylint]