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

Unified Diff: runtime/observatory/tool/ensure_dartfmt.sh

Issue 2345023003: Use dartfmt on Observatory code (Closed)
Patch Set: merge Created 4 years, 3 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 | « runtime/observatory/lib/utils.dart ('k') | runtime/observatory/web/main.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/tool/ensure_dartfmt.sh
diff --git a/runtime/observatory/tool/ensure_dartfmt.sh b/runtime/observatory/tool/ensure_dartfmt.sh
new file mode 100755
index 0000000000000000000000000000000000000000..6aa50e98d573153a51f6591c9f51a45619c48e18
--- /dev/null
+++ b/runtime/observatory/tool/ensure_dartfmt.sh
@@ -0,0 +1,15 @@
+#!/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
« no previous file with comments | « runtime/observatory/lib/utils.dart ('k') | runtime/observatory/web/main.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698