diff --git a/ci/sqlfluff-check.sh b/ci/sqlfluff-check.sh index 0cc2caf..bfde3f6 100644 --- a/ci/sqlfluff-check.sh +++ b/ci/sqlfluff-check.sh @@ -37,7 +37,10 @@ check_sql() { export -f check_sql # 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 if [ $? -ne 0 ]; then