Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(601)

Unified Diff: tool/ensure_dartfmt.sh

Issue 1138063003: pkg/box2d: 0.2.0 release (Closed) Base URL: https://github.com/google/dbox2d.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pubspec.yaml ('k') | tool/travis.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tool/ensure_dartfmt.sh
diff --git a/tool/ensure_dartfmt.sh b/tool/ensure_dartfmt.sh
new file mode 100755
index 0000000000000000000000000000000000000000..ed4e5cabd3cbf139f97ef408ca045d5fd34e22ed
--- /dev/null
+++ b/tool/ensure_dartfmt.sh
@@ -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
« no previous file with comments | « pubspec.yaml ('k') | tool/travis.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698