The dbt YAML sort order linter we introduced in https://github.com/ccao-data/data-architecture/pull/578 is awesome, but I find it annoying that I only get notified of failures after I've already pushed a commit. This PR updates our config to move the linter into pre-commit so that we can be notified of failures more proactively.
In order to speed up the pre-commit hook when installed locally, this PR also adjusts the interface for the check_sort_dbt_yaml_files.py script so that it can accept a list of filepaths from pre-commit to check for errors. When testing locally on one YAML file changed to have an incorrect sort order, the check fails nearly instantly.
The dbt YAML sort order linter we introduced in https://github.com/ccao-data/data-architecture/pull/578 is awesome, but I find it annoying that I only get notified of failures after I've already pushed a commit. This PR updates our config to move the linter into pre-commit so that we can be notified of failures more proactively.
In order to speed up the pre-commit hook when installed locally, this PR also adjusts the interface for the
check_sort_dbt_yaml_files.py
script so that it can accept a list of filepaths from pre-commit to check for errors. When testing locally on one YAML file changed to have an incorrect sort order, the check fails nearly instantly.