Repository: dbt-checkpoint/dbt-checkpoint (language: python)

Issue:
temporarily disabled on pre-commit.com/hooks -- hook name too long
hello hello!  thanks for writing an integration for pre-commit.  we've recently added a more strict requirement for hooks on the [hooks page](https://pre-commit.com/hooks) where hook `name`s must be <= 50 characters otherwise they will cause wrapping by default in pre-commit

please update your hook names to be within this requirement and then re-enable your repository (by uncommenting it) -- for more details check out https://github.com/pre-commit/pre-commit.com/pull/901

thanks!



Discussion / hints:

Fix patch:
diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml
index 4f9d6e53..1117b4ef 100644
--- a/.pre-commit-hooks.yaml
+++ b/.pre-commit-hooks.yaml
@@ -65,7 +65,7 @@
   language: python
   types_or: [sql, yaml]
 - id: check-model-has-tests-by-group
-  name: Check the model has a number of tests from a group of tests.
+  name: Check model; number of tests from group of tests.
   description: Ensures that the model has a number of tests from a group of tests.
   entry: check-model-has-tests-by-group
   language: python
@@ -95,12 +95,12 @@
   language: python
   types_or: [sql]
 - id: check-model-parents-schema
-  name: Check parent models or sources are from certain schema
+  name: Check parent models/sources from certain schema
   entry: check-model-parents-schema
   language: python
   types_or: [yaml, sql]
 - id: check-model-parents-database
-  name: Check parent models or sources are from certain database
+  name: Check parent models/sources from certain database
   entry: check-model-parents-database
   language: python
   types_or: [sql, yaml]
@@ -135,7 +135,7 @@
   language: python
   types_or: [sql]
 - id: check-source-childs
-  name: Check the source has a specific number (max/min) of childs.
+  name: Check the source has max/min number of childs.
   description: Ensures the source has a specific number (max/min) of childs.
   entry: check-source-childs
   language: python
@@ -147,7 +147,7 @@
   language: python
   types_or: [yaml]
 - id: check-source-has-all-columns
-  name: Check the source has all columns in the properties file
+  name: Check source has all columns in properties file
   description: Ensures that all columns in the database are specified in the properties file.
   entry: check-source-has-all-columns
   language: python
@@ -330,4 +330,4 @@
   description: Ensures that the test has a list of valid meta keys.
   entry: check-test-has-meta-keys
   language: python
-  types_or: [sql]
\ No newline at end of file
+  types_or: [sql]


Test patch:
diff --git a/tests/conftest.py b/tests/conftest.py
index 63447395..98453fef 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -514,3 +514,9 @@ def temp_git_dir(tmpdir):
     git_dir = tmpdir.join("gits")
     cmd_output("git", "init", "--", str(git_dir))
     yield git_dir
+
+
+@pytest.fixture(scope="module")
+def pre_commit_hooks_yaml_dict():
+    with open(".pre-commit-hooks.yaml") as f:
+        yield yaml.safe_load(f)
diff --git a/tests/unit/test_pre_commit_hooks_yaml.py b/tests/unit/test_pre_commit_hooks_yaml.py
new file mode 100644
index 00000000..b202e652
--- /dev/null
+++ b/tests/unit/test_pre_commit_hooks_yaml.py
@@ -0,0 +1,12 @@
+import pytest
+
+
+def test_hook_name_length_less_le_50_chars(pre_commit_hooks_yaml_dict):
+    """
+    Pre-commit wants all hook names to be <= 50 characters.
+    See here for more info: https://github.com/pre-commit/pre-commit.com/pull/901
+    """
+
+    for hook in pre_commit_hooks_yaml_dict:
+        if len(hook["name"]) > 50:
+            pytest.fail(f"Hook name '{hook['name']}' is longer than 50 characters")