cpplint.hook 439 字节
Newer Older
朔-望's avatar
朔-望 已提交
1 2 3 4 5
#!/bin/bash

TOTAL_ERRORS=0

# The trick to remove deleted files: https://stackoverflow.com/a/2413151
H
hjchen2 已提交
6
for file in $(git diff --cached --name-status | awk '$1 != "D" {print $2}' | \
H
hjchen2 已提交
7
        grep -v ".pb.cpp" | grep -v ".pb.h" | grep -v ".pb-c.h" | grep -v ".pb-c.c" | \
H
hjchen2 已提交
8
        grep -v "protobuf-c.h" | grep -v "protobuf-c.c" | grep -v "jni.cpp"); do
朔-望's avatar
朔-望 已提交
9 10 11 12 13
    cpplint $file;
    TOTAL_ERRORS=$(expr $TOTAL_ERRORS + $?);
done

exit $TOTAL_ERRORS