Skip to content

Commit ec8c7e3

Browse files
authored
Hide "--fix" and related options in help output. (#1195)
1 parent 6f851f6 commit ec8c7e3

File tree

5 files changed

+9
-5
lines changed

5 files changed

+9
-5
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# 2.3.1-dev
2+
3+
* Hide `--fix` and related options in `--help`. The options are still there and
4+
supported, but are no longer shown by default. Eventually, we would like all
5+
users to move to using `dart fix` instead of `dart format --fix`.
6+
17
# 2.3.0
28

39
## New language features

lib/src/cli/options.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ void defineOptions(ArgParser parser,
7474
help: 'Return exit code 1 if there are any formatting changes.');
7575

7676
if (verbose) parser.addSeparator('Non-whitespace fixes (off by default):');
77-
parser.addFlag('fix', negatable: false, help: 'Apply all style fixes.');
77+
parser.addFlag('fix',
78+
negatable: false, help: 'Apply all style fixes.', hide: !verbose);
7879

7980
for (var fix in StyleFix.all) {
80-
// TODO(rnystrom): Allow negating this if used in concert with "--fix"?
8181
parser.addFlag('fix-${fix.name}',
8282
negatable: false, help: fix.description, hide: !verbose);
8383
}

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: dart_style
22
# Note: See tool/grind.dart for how to bump the version.
3-
version: 2.3.0
3+
version: 2.3.1-dev
44
description: >-
55
Opinionated, automatic Dart source code formatter.
66
Provides an API and a CLI tool.

test/command_line_test.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ void main() {
121121
await expectLater(process.stdout, emitsThrough(contains('--overwrite')));
122122
await expectLater(
123123
process.stdout, emitsThrough(contains('--set-exit-if-changed')));
124-
await expectLater(process.stdout, emitsThrough(contains('--fix')));
125124
await process.shouldExit(0);
126125
});
127126

test/command_test.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,6 @@ void main() {
286286
expect(
287287
await process.stdout.next, 'Idiomatically format Dart source code.');
288288
await expectLater(process.stdout, emitsThrough(contains('-o, --output')));
289-
await expectLater(process.stdout, emitsThrough(contains('--fix')));
290289
await expectLater(process.stdout, neverEmits(contains('--summary')));
291290
await process.shouldExit(0);
292291
});

0 commit comments

Comments
 (0)