exclude sources as well

This commit is contained in:
Pablo Martin 2025-03-20 16:55:23 +01:00
parent a56a96d1c4
commit 61007cff09

View file

@ -37,7 +37,10 @@ check_sql() {
export -f check_sql export -f check_sql
# Run in parallel (adjust `-P` to change concurrency level) # Run in parallel (adjust `-P` to change concurrency level)
find "$SQL_DIR" -type f -name "*.sql" -not -path "*/schema.yml/*" | xargs -P 4 -I {} bash -c 'check_sql "$@"' _ {} # We exclude files contained in folders named schema.yml or ended in sources.yml
# because those are dbt generated test SQL snippets which, by definition, are
# valid.
find "$SQL_DIR" -type f -name "*.sql" -not -path "*/schema.yml/*" -not -path "*/*sources.yml/*" | xargs -P 4 -I {} bash -c 'check_sql "$@"' _ {}
# Check exit status of xargs # Check exit status of xargs
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then