dart-lang / dart_style

An opinionated formatter/linter for Dart code
https://pub.dev/packages/dart_style
BSD 3-Clause "New" or "Revised" License
646 stars 120 forks source link

dartfmt adding spurious blank lines #266

Closed DartBot closed 9 years ago

DartBot commented 9 years ago

Originally opened as dart-lang/sdk#20522

This issue was originally filed by everton.ma...@gmail.com


What steps will reproduce the problem?

  1. Get attached file camera_control.dart
  2. Save a copy as camera_control_fmt.dart
  3. Apply dartfmt to camera_control_fmt.dart
  4. diff camera_control.dart camera_control_fmt.dart

What is the expected output? diff output should be empty.

What do you see instead? Every time I run dartfmt on camera_control_fmt.dart, it adds an extra empty line:

1) After first dartfmt:

--- a/wwwroot/dart/camera_control.dart +++ b/wwwroot/dart/camera_control.dart @@ -78,7 +78,8 @­@ class CameraControl {          return;        }      } else {

       double halfEdge = cam.skyboxHalfEdge;        if (halfEdge != null) {

2) After second dartfmt:

--- a/wwwroot/dart/camera_control.dart +++ b/wwwroot/dart/camera_control.dart @@ -78,7 +78,9 @­@ class CameraControl {          return;        }      } else {

       double halfEdge = cam.skyboxHalfEdge;        if (halfEdge != null) {

What version of the product are you using? Build 38967 Dart Editor version 1.6.0.dev_08_00 (DEV) Dart SDK version 1.6.0-dev.8.0

On what operating system? 64-bit Windows 7


Attachment: camera_control.dart (2.54 KB)

DartBot commented 9 years ago

Comment by floitschG


Added Area-Formatter, Triaged labels.

DartBot commented 9 years ago

Comment by munificent


Added AssumedStale label.