From 463fed0b28f3fb0a0ad4a58b81054ae0f236a6d5 Mon Sep 17 00:00:00 2001 From: ARYAN-NIKNEZHAD Date: Thu, 29 Aug 2024 03:55:29 +0430 Subject: [PATCH 1/4] :wrench: chore: Update-pre-commit-config --- .pre-commit-config.yaml | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f8b93df..76e0117 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,38 +3,45 @@ repos: rev: v4.3.0 hooks: - 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/pre-commit/mirrors-isort rev: v5.10.1 hooks: - id: isort - exclude: docs/ + exclude: (migrations/|tests/|docs/|static/|media/).* - repo: https://github.com/psf/black rev: 23.3.0 hooks: - id: black - exclude: docs/ + args: ["--config=pyproject.toml"] + exclude: (migrations/|tests/|docs/|static/|media/).* - repo: https://github.com/pre-commit/mirrors-mypy rev: v0.991 hooks: - id: mypy args: ["--config-file=pyproject.toml"] - exclude: ^(docs/|stubs/|tests/) + exclude: (migrations/|tests/|docs/|static/|media/).* - repo: https://github.com/PyCQA/bandit rev: 1.7.4 hooks: - id: bandit - args: ["-c", "pyproject.toml"] + args: ["-c", "pyproject.toml", "-r", "."] additional_dependencies: [ "bandit[toml]" ] - exclude: ^(docs/|stubs/|tests/) + exclude: (migrations/|tests/|docs/|static/|media/).* - repo: https://github.com/codespell-project/codespell # Configuration for codespell is in .codespellrc @@ -42,3 +49,14 @@ repos: hooks: - id: codespell exclude: locale|kickstarter-announcement.md|coreapi-0.1.1.js + + - repo: local + hooks: + - id: pytest + name: Pytest + entry: poetry run pytest -v + language: system + types: [python] + stages: [commit] + pass_filenames: false + always_run: true From 472c827f680a73d1c8f584925a10c132d3343dbb Mon Sep 17 00:00:00 2001 From: ARYAN-NIKNEZHAD Date: Thu, 29 Aug 2024 04:00:53 +0430 Subject: [PATCH 2/4] :wrench: Update-pre-commit-config - Add commitizen hook --- .pre-commit-config.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 76e0117..1d508b6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -35,6 +35,12 @@ repos: args: ["--config-file=pyproject.toml"] exclude: (migrations/|tests/|docs/|static/|media/).* + - 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: From bd6776fecab07e3e8e34741c263a76d19f70671d Mon Sep 17 00:00:00 2001 From: ARYAN-NIKNEZHAD Date: Thu, 29 Aug 2024 04:16:16 +0430 Subject: [PATCH 3/4] :wrench: chore: Update-pre-commit config - Add pylint pre-commit --- .pre-commit-config.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1d508b6..d7ca1f2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -66,3 +66,17 @@ repos: 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" + +ci: + skip: [pylint] From 5f00781354dccb259fb9ba302f682040fbb108c3 Mon Sep 17 00:00:00 2001 From: ARYAN-NIKNEZHAD Date: Thu, 29 Aug 2024 04:30:01 +0430 Subject: [PATCH 4/4] :wrench: chore: Update pre-commit config - Add target folder for pylint --- .pre-commit-config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d7ca1f2..280c366 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -77,6 +77,7 @@ repos: - "-rn" - "-sn" - "--rcfile=pyproject.toml" + files: ^sage_meta/ ci: skip: [pylint]