ampproject / amp-by-example

DEPRECATED: AMP by Example has been merged into amp.dev
http://amp.dev
Apache License 2.0
753 stars 505 forks source link

Make gofmt display *which* files it had a problem with #624

Open dandv opened 7 years ago

dandv commented 7 years ago

This failed build shows that

test -z $(gofmt -l $(find . -name '*.go'))

doesn't actually "list files whose formatting differs from gofmt's" as the help for -l claims.

find . -name '*.go' | xargs gofmt -l does display the offending files.

sebastianbenz commented 7 years ago

test ... will fail the build, which the other command won't... We need the best of both worlds.

dandv commented 7 years ago

badfiles=$(find . -name '*.go' | xargs gofmt -l); echo $badfiles; test -z $badfiles