Skip to content

Commit 2b7d50c

Browse files
committed
added CLI option --exitcode-suppress
1 parent c2b5e11 commit 2b7d50c

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

.github/workflows/selfchecks-schedule.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686

8787
- name: Self check (${{ matrix.project }})
8888
run: |
89-
selfcheck_options="-j$(nproc) --std=c++11 --template=selfcheck --showtime=file-total --error-exitcode=1 --inline-suppr --suppressions-list=.selfcheck_suppressions --inconclusive --enable=style,performance,portability,warning,missingInclude,internal,information --exception-handling --debug-warnings --check-level=exhaustive"
89+
selfcheck_options="-j$(nproc) --std=c++11 --template=selfcheck --showtime=file-total --error-exitcode=1 --inline-suppr --suppressions-list=.selfcheck_suppressions --exitcode-suppress=purgedConfiguration --inconclusive --enable=style,performance,portability,warning,missingInclude,internal,information --exception-handling --debug-warnings --check-level=exhaustive"
9090
# TODO: add libraries for Visual Studio project
9191
# TODO: analyze all VS configuration
9292
./cppcheck $selfcheck_options --project=${{ matrix.project }}

cli/cmdlineparser.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,15 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
756756
}
757757
}
758758

759+
else if (std::strncmp(argv[i], "--exitcode-suppress=", 20) == 0) {
760+
const std::string suppression = argv[i]+20;
761+
const std::string errmsg(mSuppressions.nofail.addSuppressionLine(suppression));
762+
if (!errmsg.empty()) {
763+
mLogger.printError(errmsg);
764+
return Result::Fail;
765+
}
766+
}
767+
759768
// Filter errors
760769
else if (std::strncmp(argv[i], "--exitcode-suppressions=", 24) == 0) {
761770
// exitcode-suppressions=filename.txt

0 commit comments

Comments
 (0)