Skip to content

Hide "--fix" and related options in help output. #1195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 2.3.1-dev

* Hide `--fix` and related options in `--help`. The options are still there and
supported, but are no longer shown by default. Eventually, we would like all
users to move to using `dart fix` instead of `dart format --fix`.

# 2.3.0

## New language features
Expand Down
4 changes: 2 additions & 2 deletions lib/src/cli/options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ void defineOptions(ArgParser parser,
help: 'Return exit code 1 if there are any formatting changes.');

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

for (var fix in StyleFix.all) {
// TODO(rnystrom): Allow negating this if used in concert with "--fix"?
parser.addFlag('fix-${fix.name}',
negatable: false, help: fix.description, hide: !verbose);
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: dart_style
# Note: See tool/grind.dart for how to bump the version.
version: 2.3.0
version: 2.3.1-dev
description: >-
Opinionated, automatic Dart source code formatter.
Provides an API and a CLI tool.
Expand Down
1 change: 0 additions & 1 deletion test/command_line_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ void main() {
await expectLater(process.stdout, emitsThrough(contains('--overwrite')));
await expectLater(
process.stdout, emitsThrough(contains('--set-exit-if-changed')));
await expectLater(process.stdout, emitsThrough(contains('--fix')));
await process.shouldExit(0);
});

Expand Down
1 change: 0 additions & 1 deletion test/command_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ void main() {
expect(
await process.stdout.next, 'Idiomatically format Dart source code.');
await expectLater(process.stdout, emitsThrough(contains('-o, --output')));
await expectLater(process.stdout, emitsThrough(contains('--fix')));
await expectLater(process.stdout, neverEmits(contains('--summary')));
await process.shouldExit(0);
});
Expand Down