From 11027f94d982cb228f3eff2eb0135ff2b5908b2a Mon Sep 17 00:00:00 2001 From: William Jamieson Date: Wed, 9 Aug 2023 23:26:24 -0400 Subject: [PATCH 1/3] Fix the pre-commit hook. pre-commit now expects the `.pre-commit-hooks.yaml` file to be a list of hooks even if its just defining a single hook. --- .pre-commit-hooks.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index d3870a29..22ccf722 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -1,7 +1,7 @@ -id: sp-repo-review -name: sp-repo-review -description: Check for configuration best practices -entry: repo-review -language: python -types_or: [text] -minimum_pre_commit_version: 2.9.0 +- id: sp-repo-review + name: sp-repo-review + description: Check for configuration best practices + entry: repo-review + language: python + types_or: [text] + minimum_pre_commit_version: 2.9.0 From d28d9b64d7338cacbfdd9f008076e181ce87a16a Mon Sep 17 00:00:00 2001 From: William Jamieson Date: Wed, 9 Aug 2023 23:36:12 -0400 Subject: [PATCH 2/3] Don't pass file names The repo-review script does not support being passed all the individual file names by pre-commit. So turn this off and just point it at the general repo --- .pre-commit-hooks.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 22ccf722..c531c7c7 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -1,7 +1,8 @@ - id: sp-repo-review name: sp-repo-review description: Check for configuration best practices - entry: repo-review + entry: repo-review . language: python types_or: [text] + pass_filenames: false minimum_pre_commit_version: 2.9.0 From 94a33254900d1529ab150fa34adccd5bc24c8e12 Mon Sep 17 00:00:00 2001 From: William Jamieson Date: Wed, 9 Aug 2023 23:49:10 -0400 Subject: [PATCH 3/3] Add repo-review[cli] as an additional dependency Without doing this one gets errors to the effect of `ModuleNotFoundError: No module named 'click'` Diving down this rabbit hole for individual requirements ends of requiring several additional dependencies for repo-review to function properly. This solves those issues. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 60d4ab8b..8600071a 100644 --- a/README.md +++ b/README.md @@ -283,6 +283,7 @@ Or pre-commit: rev: hooks: - id: sp-repo-review + additional_dependencies: ["repo-review[cli]"] ``` ## List of checks