-
Notifications
You must be signed in to change notification settings - Fork 238
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ci] Enable cppcheck code quality report.
- Loading branch information
Showing
4 changed files
with
53 additions
and
5 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
version: "2" | ||
exclude_patterns: | ||
- "ThirdParty/" | ||
- "Tests/Data/" | ||
- "Tests/" | ||
plugins: | ||
markdownlint: | ||
enabled: true | ||
duplication: | ||
enabled: false |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Runs cppcheck with GitLab CI (CodeClimate) output | ||
OUTPUT_FILE=${PROJECT_BINARY_DIR}/cppcheck.json | ||
${CPPCHECK_TOOL_PATH} \ | ||
--project=${PROJECT_BINARY_DIR}/compile_commands.json \ | ||
--language=c++ \ | ||
--std=c++17 \ | ||
--enable=all \ | ||
--inconclusive \ | ||
-j 4 \ | ||
-i ${PROJECT_BINARY_DIR}/CMakeFiles \ | ||
-i ${PROJECT_SOURCE_DIR}/ThirdParty \ | ||
-i ${PROJECT_SOURCE_DIR}/Applications/DataExplorer \ | ||
-i ${PROJECT_SOURCE_DIR}/Tests \ | ||
--template='{\n "description": "{message}",\n "location": {\n "path": "{file}",\n "lines": {\n "begin": {line}\n }\n }\n},' \ | ||
--output-file=$OUTPUT_FILE \ | ||
|
||
echo "$( \ | ||
# add brackets | ||
printf '[\n'; \ | ||
cat $OUTPUT_FILE | \ | ||
# strip source code absolute path | ||
sed 's|${PROJECT_SOURCE_DIR}/||' | \ | ||
# escape strings | ||
sed 's/string literal "\(.*\)" to/string literal \\"\1\\" to/g' | \ | ||
# remove last comma | ||
sed '$s/,$//'; \ | ||
printf ']\n')" \ | ||
> $OUTPUT_FILE |