Created
January 5, 2021 23:17
-
-
Save kljensen/5cafb89d29ff57c68aec2dff67392883 to your computer and use it in GitHub Desktop.
Git pre-commit hook to check/lint YAML format before committing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# This file, or contents like below, should be in | |
# .git/hooks/pre-commit. If you have a YAML file | |
# with invalid formatting, the commit will be aborted. | |
# Check formatting of all yaml files. | |
# Uses yq v4. For v3 use 'r' instead of 'e' | |
fd -t f --regex '.*\.yaml' -x yq e {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment