diff --git a/gitlab/ci_template.yml b/gitlab/ci_template.yml index 66264f2197..ad15cc62e8 100644 --- a/gitlab/ci_template.yml +++ b/gitlab/ci_template.yml @@ -358,7 +358,20 @@ gst indent: script: # man indent. grep RETURN VALUE, grab a beer on my behalf... - indent --version || true - - find . -name '*.c' -exec gst-indent {} + + - | + filter_cmd="cat" + if test -f ".indentignore"; then + filter_args="" + while read -r line; do + if test -n "$line"; then + filter_args="$filter_args -e $line" + fi + done < ".indentignore" + if test -n "$filter_args"; then + filter_cmd="grep -v $filter_args" + fi + fi + find . -name '*.c' | $filter_cmd | xargs gst-indent - | if git diff --quiet; then echo "Code is properly formatted"