diff options
| author | Xiang Dai <long0dai@foxmail.com> | 2020-06-09 14:12:22 +0800 |
|---|---|---|
| committer | Xiang Dai <long0dai@foxmail.com> | 2020-06-09 15:21:41 +0800 |
| commit | d3ae2dc01655a59795b2d47b38238a56786c066b (patch) | |
| tree | 6654b173552c4e95e5ca2d3e9f61b58f59b6c31b /hack/lib/lint.sh | |
| parent | Merge pull request #1782 from fisherxu/use-1.3.1 (diff) | |
| download | kubeedge-d3ae2dc01655a59795b2d47b38238a56786c066b.tar.gz | |
hack/lib/lint.sh: skip deleted files
Signed-off-by: Xiang Dai <long0dai@foxmail.com>
Diffstat (limited to 'hack/lib/lint.sh')
| -rw-r--r-- | hack/lib/lint.sh | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/hack/lib/lint.sh b/hack/lib/lint.sh index 692f75018..96cdb403e 100644 --- a/hack/lib/lint.sh +++ b/hack/lib/lint.sh @@ -22,8 +22,13 @@ set -o pipefail kubeedge::lint::check() { cd ${KUBEEDGE_ROOT} - git diff --cached --name-only master | grep -Ev "externalversions|fake|vendor" | xargs sed -i 's/[ \t]*$//' - [[ $(git diff --name-only) ]] && return 1 + # skip deleted files + git diff --cached --name-only --diff-filter=ACRMTU master | grep -Ev "externalversions|fake|vendor" | xargs --no-run-if-empty sed -i 's/[ \t]*$//' + + [[ $(git diff --name-only) ]] && { + echo "Some files have white noise issue, please run `make lint` to check" + return 1 + } golangci-lint run gofmt -l -w staging } |
