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

Unified Diff: bin/format.dart

Issue 2333373003: Add a command-line option to set the exit code on a formatting change. (Closed)
Patch Set: 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 | « CHANGELOG.md ('k') | lib/src/debug.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bin/format.dart
diff --git a/bin/format.dart b/bin/format.dart
index 72182bf0ea96f98cc9f08d597d3bbb754ede9e60..a8a00e2480abcade376ba9ea308100350f48ee96 100644
--- a/bin/format.dart
+++ b/bin/format.dart
@@ -33,6 +33,9 @@ void main(List<String> args) {
abbr: "n",
negatable: false,
help: "Show which files would be modified but make no changes.");
+ parser.addFlag("set-exit-if-changed",
+ negatable: false,
+ help: "Return exit code 1 if there are any formatting changes.");
parser.addFlag("overwrite",
abbr: "w",
negatable: false,
@@ -119,6 +122,10 @@ void main(List<String> args) {
reporter = new ProfileReporter(reporter);
}
+ if (argResults["set-exit-if-changed"]) {
+ reporter = new SetExitReporter(reporter);
+ }
+
var pageWidth;
try {
pageWidth = int.parse(argResults["line-length"]);
« no previous file with comments | « CHANGELOG.md ('k') | lib/src/debug.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698