6c31582031
Change-Id: If47aa98918b0166dba781a0008c23b991d46fe1c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165420 Reviewed-by: Ben Konyi <bkonyi@google.com> Commit-Queue: Ryan Macnak <rmacnak@google.com>
16 lines
353 B
Bash
Executable File
16 lines
353 B
Bash
Executable File
#!/bin/sh
|
|
|
|
dart_files=$(find lib web -name "*.dart")
|
|
[ -z "$dart_files" ] && exit 0
|
|
|
|
unformatted=$(dartfmt -n $dart_files)
|
|
[ -z "$unformatted" ] && exit 0
|
|
|
|
# Some files are not dartfmt'd. Print message and fail.
|
|
echo >&2 "dart files must be formatted with dartfmt. Please run:"
|
|
for fn in $unformatted; do
|
|
echo >&2 " dartfmt -w $PWD/$fn"
|
|
done
|
|
|
|
exit 1
|