Permalink
Browse files

ensure dart source is formatted

  • Loading branch information...
kevmoo committed Apr 7, 2015
1 parent 804e93e commit bded05b2f3f9a46e5f592f0bddea52d140b7fa67
Showing with 17 additions and 0 deletions.
  1. +15 −0 tool/ensure_dartfmt.sh
  2. +2 −0 tool/travis.sh
View
@@ -0,0 +1,15 @@
#!/bin/sh
dart_files=$(git ls-tree --name-only --full-tree -r HEAD | grep '.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
View
@@ -7,6 +7,8 @@
# Fast fail the script on failures.
set -e
$(dirname -- "$0")/ensure_dartfmt.sh
# Globally install grinder.
pub global activate grinder
export PATH="$PATH":"~/.pub-cache/bin"

0 comments on commit bded05b

Please sign in to comment.