Skip to content

Commit

Permalink
【code format check upgrade】 step1:cpplint (#43175)
Browse files Browse the repository at this point in the history
* test=document_fix

* cpplint set version 1.6.0;test=document_fix
  • Loading branch information
betterpig authored Jun 6, 2022
1 parent e860538 commit 19b4ff4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions tools/codestyle/cpplint_pre_commit.hook
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
#!/bin/bash

TOTAL_ERRORS=0

readonly VERSION="1.6.0"

version=$(cpplint --version)

if [[ ! $TRAVIS_BRANCH ]]; then
# install cpplint on local machine.
if [[ ! $(which cpplint) ]]; then
pip install cpplint
if ! [[ $version == *"$VERSION"* ]]; then
pip install cpplint==1.6.0
fi
# diff files on local machine.
files=$(git diff --cached --name-status | awk '$1 != "D" {print $2}')
Expand Down
2 changes: 1 addition & 1 deletion tools/codestyle/pylint_pre_commit.hook
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ readonly VERSION="2.12.0"
version=$(pylint --version | grep 'pylint')

if ! [[ $version == *"$VERSION"* ]]; then
pip install pylint==2.12.0 1>nul
pip install pylint==2.12.0
fi

# The trick to remove deleted files: https://stackoverflow.com/a/2413151
Expand Down

0 comments on commit 19b4ff4

Please sign in to comment.