Skip to content

Commit dcd1234

Browse files
committed
use git ls-files instead of find
1 parent 1bfb0bd commit dcd1234

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

scripts/lint.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,13 @@ format(){
4242
exit 1
4343
fi
4444

45-
GOFMT_OUTPUT="$(find "./sdk" "./node" "./wormchain" \
46-
\( -name node_modules -prune \) -o \
47-
\( -name .gocache -prune \) -o \
48-
\( -name target -prune \) -o \
49-
-type f -name '*.go' -not -path '*.pb.go' -print0 | xargs -r -0 goimports $GOIMPORTS_ARGS 2>&1)"
45+
46+
GOFMT_OUTPUT="$(git -C "$ROOT" ls-files -z --cached -- \
47+
'sdk/**/*.go' \
48+
'node/**/*.go' \
49+
'wormchain/**/*.go' \
50+
':(exclude)**/*.pb.go' \
51+
| xargs -r -0 goimports $GOIMPORTS_ARGS 2>&1)"
5052

5153
if [ -n "$GOFMT_OUTPUT" ]; then
5254
if [ "$GITHUB_ACTION" == "true" ]; then

0 commit comments

Comments
 (0)