This is an automated email from the ASF dual-hosted git repository.

zghao pushed a commit to branch HBASE-14850
in repository https://gitbox.apache.org/repos/asf/hbase.git

commit d5f600ef8c24d08590fb967982364c274c669957
Author: Enis Soztutar <[email protected]>
AuthorDate: Mon Dec 5 15:10:28 2016 -0800

    HBASE-17218 [C++] Use Google Style guide and cpplint
---
 hbase-native-client/Makefile                           |  3 +++
 hbase-native-client/bin/{format-code.sh => cpplint.sh} | 10 +++++++---
 hbase-native-client/bin/format-code.sh                 |  2 +-
 3 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/hbase-native-client/Makefile b/hbase-native-client/Makefile
index 64cef06..be5d461 100644
--- a/hbase-native-client/Makefile
+++ b/hbase-native-client/Makefile
@@ -116,6 +116,9 @@ $(foreach bdir,$(RELEASE_BUILD_DIR),$(eval $(call 
make-goal-rel,$(bdir))))
 check:
        $(shell buck test --all --no-results-cache)
 
+lint:
+       bin/cpplint.sh
+
 doc:
        $(shell doxygen hbase.doxygen > /dev/null)
 
diff --git a/hbase-native-client/bin/format-code.sh 
b/hbase-native-client/bin/cpplint.sh
old mode 100755
new mode 100644
similarity index 78%
copy from hbase-native-client/bin/format-code.sh
copy to hbase-native-client/bin/cpplint.sh
index cc8b368..52ca581
--- a/hbase-native-client/bin/format-code.sh
+++ b/hbase-native-client/bin/cpplint.sh
@@ -15,9 +15,13 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
-set -euo pipefail
 IFS=$'\n\t'
 
+CPPLINT_LOC=https://raw.githubusercontent.com/google/styleguide/gh-pages/cpplint/cpplint.py
+OUTPUT=build/cpplint.py
 
-find core connection serde utils test-util -name "*.h" -or -name "*.cc" | 
xargs -P8 clang-format -i
-find core connection serde utils third-party -name "BUCK" | xargs -P8 yapf -i
+# Download if not already there
+wget -nc $CPPLINT_LOC -O $OUTPUT
+
+# Execute the script
+find core connection serde utils test-util -name "*.h" -or -name "*.cc" | 
xargs -P8 python $OUTPUT
diff --git a/hbase-native-client/bin/format-code.sh 
b/hbase-native-client/bin/format-code.sh
index cc8b368..331717a 100755
--- a/hbase-native-client/bin/format-code.sh
+++ b/hbase-native-client/bin/format-code.sh
@@ -19,5 +19,5 @@ set -euo pipefail
 IFS=$'\n\t'
 
 
-find core connection serde utils test-util -name "*.h" -or -name "*.cc" | 
xargs -P8 clang-format -i
+find core connection serde utils test-util -name "*.h" -or -name "*.cc" | 
xargs -P8 clang-format -i --style=Google
 find core connection serde utils third-party -name "BUCK" | xargs -P8 yapf -i

Reply via email to