Remove extra '(' #434
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: cppcheck | |
on: [push] | |
jobs: | |
build: | |
name: cppcheck-test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: cppcheck | |
uses: deep5050/cppcheck-action@main | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN}} | |
std: c++17 | |
inline_suppression: enable | |
exclude_check: ./tests | |
output_file: cppcheck_report.txt | |
other_options: --library=wxwidgets,windows | |
- name: print output | |
run: | | |
REPORTFILE=./cppcheck_report.txt | |
WARNINGSFILE=./warnings.txt | |
if test -f "$REPORTFILE"; then | |
# Filter innocuous warnings and write the remaining ones to another file. | |
# Note that you can add more warnings by adding it in the parenthesis, | |
# with "\|" in front of it. For example, "(missingIncludeSystem\|useStlAlgorithm\)" | |
sed 's/\[\(missingIncludeSystem\|assertWithSideEffect\|unknownMacro\|internalAstError\|missingInclude\|unusedFunction\|ConfigurationNotChecked\|toomanyconfigs\|unmatchedSuppression\|useStlAlgorithm\)\]//g' "$REPORTFILE" > "$WARNINGSFILE" | |
# are there any remaining warnings? | |
if grep -qP '\[[a-zA-Z0-9]{5,}\]' "$WARNINGSFILE"; then | |
# print the remaining warnings | |
echo Warnings detected: | |
echo ================== | |
cat "$WARNINGSFILE" | grep -P '\[[a-zA-Z0-9]{5,}\]' | |
# fail the job | |
exit 1 | |
else | |
echo No warnings detected | |
fi | |
else | |
echo "$REPORTFILE" not found | |
fi |