google / dart-neats

neat dart packages.
Apache License 2.0
466 stars 86 forks source link

Feature request: formatting for dartdoc_test #253

Open sigurdm opened 2 months ago

sigurdm commented 2 months ago

It would be awesome to have:

A command for running dart format across the text of the code samples. (That would modify the code inside the comments)

> dart run dartdoc_test format
Formatted 2 files (1 changed) in 0.10 seconds.

Changes:

/// This class is excellent
/// ```dart
/// void main() {
/// foo();
/// }
/// ```
class Foo {}

to

/// This class is excellent
/// ```dart
/// void main() {
///   foo();
/// }
/// ```
class Foo {}

And also having a test that validates that formatting is done.

And a separate