forked from cuberite/cuberite
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use clang-tidy to check more code conventions (cuberite#4214)
* Create clang-tidy.sh * Add clang-tidy to circle.yml * Fixed some naming violations Fixes cuberite#4164
- Loading branch information
1 parent
fbf5cf7
commit b9fdaf8
Showing
13 changed files
with
224 additions
and
168 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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Checks: '-*,readability-identifier-naming' | ||
CheckOptions: | ||
- key: readability-identifier-naming.PrivateMemberPrefix | ||
value: 'm_' | ||
- key: readability-identifier-naming.ClassConstantCase | ||
value: aNy_CasE | ||
# an empty *Prefix needs a *Case to work | ||
- key: readability-identifier-naming.ClassConstantPrefix | ||
value: '' | ||
#- key: readability-identifier-naming.PrivateMemberCase | ||
# value: CamelCase | ||
#- key: readability-identifier-naming.FunctionCase | ||
# value: CamelCase | ||
#- key: readability-identifier-naming.EnumCase | ||
# value: camelBack | ||
WarningsAsErrors: '*' | ||
HeaderFilterRegex: '/cuberite/src/\.?[^\.]' |
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,19 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
FIXES_FILE="tidy-fixes.yaml" | ||
REGEX="/cuberite/src/\.?[^\.]" | ||
# TODO: Add -quiet when Circle CI is updated to 2.0 with a newer version of Ubuntu | ||
ARGS="-header-filter $REGEX -export-fixes $FIXES_FILE "$@" $REGEX" | ||
|
||
mkdir -p tidy-build | ||
cd tidy-build | ||
cmake --target Cuberite -DCMAKE_EXPORT_COMPILE_COMMANDS=ON .. | ||
|
||
if run-clang-tidy.py $ARGS; then | ||
echo "clang-tidy: No violations found" | ||
else | ||
echo "clang-tidy: Found violations" | ||
exit 1 | ||
fi |
Oops, something went wrong.