Skip to content

Commit 2235b26

Browse files
committed
[FAB-8975] Exclude testdata from linting/license
Change-Id: I9170a5a94ec5dab871363d65cb5e0020f38645cc Signed-off-by: Matthew Sykes <sykesmat@us.ibm.com>
1 parent 621725f commit 2235b26

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

scripts/check_license.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
function filterExcludedFiles {
99
CHECK=`echo "$CHECK" | grep -v .png$ | grep -v .rst$ | grep -v ^.git/ \
1010
| grep -v .pem$ | grep -v .block$ | grep -v .tx$ | grep -v ^LICENSE$ | grep -v _sk$ \
11-
| grep -v .key$ | grep -v \\.gen.go$ | grep -v ^Gopkg.lock$ \
11+
| grep -v .key$ | grep -v \\.gen.go$ | grep -v ^Gopkg.lock$ | grep -v 'testdata/' \
1212
| grep -v .md$ | grep -v ^vendor/ | grep -v ^build/ | grep -v .pb.go$ | sort -u`
1313
}
1414

scripts/golinter.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ do
2727
echo ">>>Checking code under $i/"
2828

2929
echo "Checking with gofmt"
30-
OUTPUT="$(gofmt -l -s ./$i)"
30+
OUTPUT="$(gofmt -l -s ./$i | grep -v testdata/ || true)"
3131
if [[ $OUTPUT ]]; then
3232
echo "The following files contain gofmt errors"
3333
echo "$OUTPUT"
@@ -36,7 +36,7 @@ do
3636
fi
3737

3838
echo "Checking with goimports"
39-
OUTPUT="$(goimports -srcdir $GOPATH/src/github.com/hyperledger/fabric -l $i)"
39+
OUTPUT="$(goimports -srcdir $GOPATH/src/github.com/hyperledger/fabric -l $i | grep -v testdata/ || true )"
4040
if [[ $OUTPUT ]]; then
4141
echo "The following files contain goimports errors"
4242
echo $OUTPUT

0 commit comments

Comments
 (0)