forked from PaddlePaddle/docs
-
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.
[MOT] add cpplint & refine format in pptracking (PaddlePaddle#4501)
- Loading branch information
Showing
22 changed files
with
1,680 additions
and
1,636 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
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,15 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
readonly VERSION="3.8" | ||
|
||
version=$(clang-format -version) | ||
|
||
if ! [[ $version == *"$VERSION"* ]]; then | ||
echo "clang-format version check failed." | ||
echo "a version contains '$VERSION' is needed, but get '$version'" | ||
echo "you can install the right version, and make an soft-link to '\$PATH' env" | ||
exit -1 | ||
fi | ||
|
||
clang-format $@ |
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,27 @@ | ||
#!/bin/bash | ||
|
||
TOTAL_ERRORS=0 | ||
if [[ ! $TRAVIS_BRANCH ]]; then | ||
# install cpplint on local machine. | ||
if [[ ! $(which cpplint) ]]; then | ||
pip install cpplint | ||
fi | ||
# diff files on local machine. | ||
files=$(git diff --cached --name-status | awk '$1 != "D" {print $2}') | ||
else | ||
# diff files between PR and latest commit on Travis CI. | ||
branch_ref=$(git rev-parse "$TRAVIS_BRANCH") | ||
head_ref=$(git rev-parse HEAD) | ||
files=$(git diff --name-status $branch_ref $head_ref | awk '$1 != "D" {print $2}') | ||
fi | ||
# The trick to remove deleted files: https://stackoverflow.com/a/2413151 | ||
for file in $files; do | ||
if [[ $file =~ ^(patches/.*) ]]; then | ||
continue; | ||
else | ||
cpplint --filter=-readability/fn_size,-build/include_what_you_use,-build/c++11 $file; | ||
TOTAL_ERRORS=$(expr $TOTAL_ERRORS + $?); | ||
fi | ||
done | ||
|
||
exit $TOTAL_ERRORS |
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
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
Oops, something went wrong.