Skip to content

Commit 96cca43

Browse files
authored
Remove outdated references to "dartfmt". (#1065)
* Remove outdated references to "dartfmt". There are still a few in the repo, but they are in code that exists to implement or test the legacy CLI. Those will go away when support for that is fully removed from the package in a future change. * Remove more uses.
1 parent faf8672 commit 96cca43

File tree

6 files changed

+10
-18
lines changed

6 files changed

+10
-18
lines changed

README.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,17 +99,9 @@ If you need to run a different version of the formatter, you can
9999
[globally activate][] the package from the dart_style package on
100100
pub.dev:
101101

102-
$ pub global activate dart_style
103-
$ dartfmt ...
104-
105-
For this to work, you need to put pub's bin directory on your PATH before the
106-
Dart SDK directory. Otherwise, the SDK's dartfmt will shadow this one.
107-
108102
[globally activate]: https://dart.dev/tools/pub/cmd/pub-global
109103

110-
If you don't want pub to put `dartfmt` on your PATH, you can run it explicitly:
111-
112-
$ pub global activate dart_style --no-executables
104+
$ pub global activate dart_style
113105
$ pub global run dart_style:format ...
114106

115107
## Using the dart_style API

lib/src/source_visitor.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2284,8 +2284,8 @@ class SourceVisitor extends ThrowingAstVisitor {
22842284
//
22852285
// That ensures that the way some code is formatted is not affected by the
22862286
// presence or absence of `new`/`const`. In particular, it means that if
2287-
// they run `dartfmt --fix`, and then run `dartfmt` *again*, the second run
2288-
// will not produce any additional changes.
2287+
// they run `dart format --fix`, and then run `dart format` *again*, the
2288+
// second run will not produce any additional changes.
22892289
if (node.target == null || looksLikeStaticCall(node)) {
22902290
// Try to keep the entire method invocation one line.
22912291
builder.nestExpression();

lib/src/string_compare.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/// Returns `true` if [c] represents a whitespace code unit allowed in Dart
22
/// source code.
33
///
4-
/// This follows the same rules as `String.trim()` because that's what dartfmt
5-
/// uses to trim trailing whitespace.
4+
/// This follows the same rules as `String.trim()` because that's what
5+
/// dart_style uses to trim trailing whitespace.
66
bool _isWhitespace(int c) {
77
// Not using a set or something more elegant because this code is on the hot
88
// path and this large expression is significantly faster than a set lookup.

test/fixes/doc_comments.stmt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ This is an ugly dartdoc comment that contains a code block.
166166
Foo(this.x);
167167
}
168168

169-
The formatting gets messed up by `dartfmt --fix-doc-comments`.
169+
The formatting gets messed up by `dart format --fix-doc-comments`.
170170
*/
171171
m() {}
172172
<<<
@@ -177,7 +177,7 @@ m() {}
177177
/// Foo(this.x);
178178
/// }
179179
///
180-
/// The formatting gets messed up by `dartfmt --fix-doc-comments`.
180+
/// The formatting gets messed up by `dart format --fix-doc-comments`.
181181
m() {}
182182
>>> strip leading indentation shared by all lines
183183
/** 4

test/whitespace/methods.unit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class A {
4949
named({covariant int a, covariant b});
5050
fn(covariant int f(bool b));
5151
}
52-
>>> covariant in initializing formal (not valid, but dartfmt should accept)
52+
>>> covariant in initializing formal (not valid, but dart format should accept)
5353
class A {
5454
A( covariant this.foo);
5555
}

tool/command_shell.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import 'package:dart_style/src/cli/format_command.dart';
1212
/// This enables tests to spawn this executable in order to verify the output
1313
/// it prints.
1414
void main(List<String> arguments) async {
15-
var runner =
16-
CommandRunner<int>('dartfmt', 'Idiomatically format Dart source code.');
15+
var runner = CommandRunner<int>(
16+
'command_shell', 'Idiomatically format Dart source code.');
1717
runner.argParser.addFlag('verbose',
1818
abbr: 'v', negatable: false, help: 'Show verbose help.');
1919
runner.addCommand(FormatCommand(

0 commit comments

Comments
 (0)