File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 4444 if grep -qP '\{\{[%{#]' "$file"; then
4545 # File contains Jinja2 constructs — strip them before linting.
4646 # yamllint -s exits: 0 = clean, 1 = errors, 2 = warnings only.
47+ # Use "|| rc=$?" to prevent set -e from killing the script before
48+ # we can capture the exit code and print the diagnostic output.
49+ rc=0
4750 output=$(python3 utils/strip_jinja_for_yamllint.py "$file" \
48- | yamllint -s -c .yamllint - 2>&1)
49- rc=$?
51+ | yamllint -s -c .yamllint - 2>&1) || rc=$?
5052 # Show all output (warnings and errors), replacing "stdin"
5153 # with the actual filename since yamllint reads from a pipe.
5254 if [ -n "$output" ]; then
5759 exit_code=1
5860 fi
5961 else
60- yamllint -s -c .yamllint "$file"
61- rc=$?
62+ rc=0
63+ yamllint -s -c .yamllint "$file" || rc=$?
6264 if [ "$rc" -eq 1 ]; then
6365 exit_code=1
6466 fi
You can’t perform that action at this time.
0 commit comments