I thought that this landed over a month ago. This needs to be rolled into the Dart SDK 2.9
New output from dart format --help:
Idiomatically formats Dart source code.
Usage: dart format [options...] <files or directories...>
-h, --help Print this usage information.
Common options:
-o, --output Where formatted output should be written.
[json] Print code and selection as JSON
[none] Discard.
[show] Print code to terminal.
[write] (default) Overwrite formatted files on disc.
--show Which filenames to print.
[all] All visited files and directories.
[changed] (default) Only the names of files whose formatting is changed.
[none] No file names or directories.
--summary Summary shown after formatting completes.
[line] (default) Single line summary.
[none] No summary.
[profile] Tracks how long it took for format each file.
Non-whitespace fixes (off by default):
--fix Apply all style fixes.
--fix-doc-comments Use triple slash for documentation comments.
--fix-function-typedefs Use new syntax for function type typedefs.
--fix-named-default-separator Use "=" as the separator before named parameter default values.
--fix-optional-const Remove "const" keyword inside constant context.
--fix-optional-new Remove "new" keyword.
--fix-single-cascade-statements Remove unnecessary single cascades from expression statements.
Other options:
-l, --line-length Wrap lines longer than this.
(defaults to "80")
-i, --indent Spaces of leading indentation.
(defaults to "0")
--set-exit-if-changed Return exit code 1 if there are any formatting changes.
--follow-links Follow links to files and directories.
If unset, links will be ignored.
--version Show version information.
Options when formatting from stdin:
--selection Selection to preserve formatted as "start:length".
--stdin-name The path name to show when an error occurs.
(defaults to "stdin")
Run "dart help" to see global options.
Change-Id: I18a49abd919672e988296f83c23636b14c29bdeb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153900
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
Dart
A client-optimized language for fast apps on any platform
Dart is:
-
Optimized for UI: Develop with a programming language specialized around the needs of user interface creation
-
Productive: Make changes iteratively: use hot reload to see the result instantly in your running app
-
Fast on all platforms: Compile to ARM & x64 machine code for mobile, desktop, and backend. Or compile to JavaScript for the web
Dart's flexible compiler technology lets you run Dart code in different ways, depending on your target platform and goals:
-
Dart Native: For programs targeting devices (mobile, desktop, server, and more), Dart Native includes both a Dart VM with JIT (just-in-time) compilation and an AOT (ahead-of-time) compiler for producing machine code.
-
Dart Web: For programs targeting the web, Dart Web includes both a development time compiler (dartdevc) and a production time compiler (dart2js).
License & patents
Dart is free and open source.
See LICENSE and PATENT_GRANT.
Using Dart
Visit the dart.dev to learn more about the language, tools, getting started, and more.
Browse pub.dev for more packages and libraries contributed by the community and the Dart team.
Building Dart
If you want to build Dart yourself, here is a guide to getting the source, preparing your machine to build the SDK, and building.
There are more documents on our wiki.
Contributing to Dart
The easiest way to contribute to Dart is to file issues.
You can also contribute patches, as described in Contributing.