Skip to content

Commit

Permalink
fix: ensure summary is always displayed by properly capturing and dis…
Browse files Browse the repository at this point in the history
…playing output

Co-Authored-By: [email protected] <[email protected]>
  • Loading branch information
1 parent a3f497f commit f2af273
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions scripts/run_cppcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ generate_summary() {
} | tee summary.txt
}

# Run cppcheck and capture output to temporary file
cppcheck \
# Run cppcheck and capture output
exec 5>&1
CPPCHECK_OUTPUT=$(cppcheck \
--enable=all \
--check-level=exhaustive \
--inconclusive \
Expand All @@ -75,11 +76,11 @@ cppcheck \
--check-library \
--debug-warnings \
--error-exitcode=1 \
. > cppcheck_output.txt 2>&1
. 2>&1)
CPPCHECK_EXIT_CODE=$?

# Display cppcheck output
cat cppcheck_output.txt
# Save output to file and display it
echo "$CPPCHECK_OUTPUT" | tee cppcheck_output.txt

echo
echo "=== Static Analysis Summary ==="
Expand Down

0 comments on commit f2af273

Please sign in to comment.