misc: Add additional pre-commit hook checks (#420)

Adds the following hooks:

1. `check-ast`: Verifies all Python files have a AST indicating they are
valid Python.
2. `check-merge-conflict`: Checks to see if files have merge conflict
strings and blocks commits if so.
3. `check-symlinks`: Checks that symlinks in the repo still point to a
valid location.
4. `destroyed-symlinks`: Checks if symlink is replaced with a file and
if that file is identical to the file it was previously pointing too.

None of these commits change any code. They are all checks to ensure bad
code is not committed.
This commit is contained in:
Bobby R. Bruce
2023-10-18 12:21:22 -07:00
committed by GitHub

View File

@@ -62,7 +62,11 @@ repos:
- id: check-added-large-files - id: check-added-large-files
- id: mixed-line-ending - id: mixed-line-ending
args: [--fix=lf] args: [--fix=lf]
- id: check-ast
- id: check-case-conflict - id: check-case-conflict
- id: check-merge-conflict
- id: check-symlinks
- id: destroyed-symlinks
- id: requirements-txt-fixer - id: requirements-txt-fixer
- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt - repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
rev: 0.2.3 rev: 0.2.3