From 132ec10818bac8cebc46b1ffd527d243fdf43a31 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Thu, 5 Oct 2023 19:26:01 -0700 Subject: [PATCH 1/4] python,misc: Add `check-ast` hook to pre-commit This verifies all Python files have a AST indicating they valid Python. No file in the repo fails this test, so it triggered no changes. Change-Id: Ifd7998268df6be766d92c19cfc7f1cfdf8ed103e --- .pre-commit-config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 040c81089f..c7faabcc60 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -62,6 +62,7 @@ repos: - id: check-added-large-files - id: mixed-line-ending args: [--fix=lf] + - id: check-ast - id: check-case-conflict - id: requirements-txt-fixer - repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt From 5b5c5d09ddba06248a35b2df7fa5b815aafb9b92 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Thu, 5 Oct 2023 19:34:07 -0700 Subject: [PATCH 2/4] python,misc: Add `check-merge-conflict` hook to pre-commit This hook will check to see if files have merge conflict strings and blocks commit if so. Change-Id: I8687e0a8367d3c43133890001023e0352954d90d --- .pre-commit-config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c7faabcc60..4435b881dc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -64,6 +64,7 @@ repos: args: [--fix=lf] - id: check-ast - id: check-case-conflict + - id: check-merge-conflict - id: requirements-txt-fixer - repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt rev: 0.2.3 From 768e488a6bb237394ccbf2903ea01ac063acf139 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Thu, 5 Oct 2023 19:37:04 -0700 Subject: [PATCH 3/4] python,misc: Add `check-symlinks` hook to pre-commit This hook checks that symlinks in the repo still point to valid location. Change-Id: I350760800406d9c003e81236af8248c6fc0a7359 --- .pre-commit-config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4435b881dc..ab2b8be79f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -65,6 +65,7 @@ repos: - id: check-ast - id: check-case-conflict - id: check-merge-conflict + - id: check-symlinks - id: requirements-txt-fixer - repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt rev: 0.2.3 From 592fbae2f58d8cc75262711f04b7593cecc967fe Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Thu, 5 Oct 2023 19:40:36 -0700 Subject: [PATCH 4/4] python,misc: Add `destroyed-symlinks` hook to pre-commit This hook detects which symlinks are changed to regular files with the content of a path which that symlink was pointing to. Change-Id: Ic925f02debc65c7c04e6d4cc3a25415b30858977 --- .pre-commit-config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ab2b8be79f..d03de87ee1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -66,6 +66,7 @@ repos: - id: check-case-conflict - id: check-merge-conflict - id: check-symlinks + - id: destroyed-symlinks - id: requirements-txt-fixer - repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt rev: 0.2.3