From fef15a55313619e9d23b9472a2d2f6d84859c86e Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Mon, 9 Sep 2024 00:34:31 +0100 Subject: [PATCH 1/3] Specify Python module use in pre-commit hooks --- .pre-commit-config.yaml | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2e27ed8de..e318c83e9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,7 +28,7 @@ repos: hooks: - id: custom-linters name: custom-linters - entry: pytest ci/custom_linters.py + entry: python -m pytest ci/custom_linters.py stages: [push] language: system types_or: [yaml, python] @@ -36,7 +36,7 @@ repos: - id: actionlint name: actionlint - entry: actionlint + entry: python -m actionlint language: system pass_filenames: false types_or: [yaml] @@ -44,7 +44,7 @@ repos: - id: mypy name: mypy stages: [push] - entry: mypy . + entry: python -m mypy . language: system types_or: [python, toml] pass_filenames: false @@ -52,14 +52,14 @@ repos: - id: check-manifest name: check-manifest stages: [push] - entry: check-manifest . + entry: python -m check-manifest . language: system pass_filenames: false - id: pyright name: pyright stages: [push] - entry: pyright . + entry: python -m pyright . language: system types_or: [python, toml] pass_filenames: false @@ -67,33 +67,33 @@ repos: - id: pyright-verifytypes name: pyright-verifytypes stages: [push] - entry: pyright --verifytypes mock_vws + entry: python -m pyright --verifytypes mock_vws language: system pass_filenames: false types_or: [python] - id: vulture name: vulture - entry: vulture --min-confidence 100 --exclude .eggs + entry: python -m vulture --min-confidence 100 --exclude .eggs language: system types_or: [python] - id: pyroma name: pyroma - entry: pyroma --min 10 . + entry: python -m pyroma --min 10 . language: system pass_filenames: false types_or: [toml] - id: deptry name: deptry - entry: deptry src/ + entry: python -m deptry src/ language: system pass_filenames: false - id: pylint name: pylint - entry: pylint *.py src/ tests/ docs/ ci/ + entry: python -m pylint *.py src/ tests/ docs/ ci/ language: system stages: [manual] pass_filenames: false @@ -107,55 +107,55 @@ repos: # We choose not to use a Python wrapper or alternative to hadolint as none # appear to be well maintained, and they require more setup than we would # want. - entry: ghcr.io/hadolint/hadolint hadolint + entry: python -m ghcr.io/hadolint/hadolint hadolint - id: ruff-check name: Ruff check - entry: ruff check + entry: python -m ruff check language: system types_or: [python] - id: ruff-format-diff name: Ruff format diff - entry: ruff format --diff + entry: python -m ruff format --diff language: system types_or: [python] - id: ruff-check-fix name: Ruff check fix - entry: ruff check --fix + entry: python -m ruff check --fix language: system types_or: [python] - id: ruff-format-fix name: Ruff format - entry: ruff format + entry: python -m ruff format language: system types_or: [python] - id: doc8 name: doc8 - entry: doc8 + entry: python -m doc8 language: system types_or: [rst] - id: interrogate name: interrogate - entry: interrogate src/ tests/ ci/ + entry: python -m interrogate src/ tests/ ci/ language: system types_or: [python] exclude_types: [executable] - id: pyproject-fmt-check name: pyproject-fmt check - entry: pyproject-fmt --check + entry: python -m pyproject-fmt --check language: system types_or: [toml] files: pyproject.toml - id: pyproject-fmt-fix name: pyproject-fmt - entry: pyproject-fmt + entry: python -m pyproject-fmt language: system types_or: [toml] files: pyproject.toml From 4a4f57cc73238e26e5a22f0c6ec0bc21d4fd54f3 Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Mon, 9 Sep 2024 00:36:41 +0100 Subject: [PATCH 2/3] Specify Python module use in pre-commit hooks --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e318c83e9..dc7110334 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,7 +36,7 @@ repos: - id: actionlint name: actionlint - entry: python -m actionlint + entry: actionlint language: system pass_filenames: false types_or: [yaml] @@ -148,14 +148,14 @@ repos: - id: pyproject-fmt-check name: pyproject-fmt check - entry: python -m pyproject-fmt --check + entry: pyproject-fmt --check language: system types_or: [toml] files: pyproject.toml - id: pyproject-fmt-fix name: pyproject-fmt - entry: python -m pyproject-fmt + entry: pyproject-fmt language: system types_or: [toml] files: pyproject.toml From f4d461d4c46771299ef09f627982b4a6fbce328e Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Mon, 9 Sep 2024 00:40:33 +0100 Subject: [PATCH 3/3] Specify Python module use in pre-commit hooks --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index dc7110334..ec1f4c6bc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -52,7 +52,7 @@ repos: - id: check-manifest name: check-manifest stages: [push] - entry: python -m check-manifest . + entry: python -m check_manifest . language: system pass_filenames: false @@ -107,7 +107,7 @@ repos: # We choose not to use a Python wrapper or alternative to hadolint as none # appear to be well maintained, and they require more setup than we would # want. - entry: python -m ghcr.io/hadolint/hadolint hadolint + entry: ghcr.io/hadolint/hadolint hadolint - id: ruff-check name: Ruff check