{"action":"created","issue":{"url":"https://api.github.com/repos/dart-lang/dart_style/issues/472","labels_url":"https://api.github.com/repos/dart-lang/dart_style/issues/472/labels{/name}","comments_url":"https://api.github.com/repos/dart-lang/dart_style/issues/472/comments","events_url":"https://api.github.com/repos/dart-lang/dart_style/issues/472/events","html_url":"https://github.com/dart-lang/dart_style/issues/472","id":119808043,"number":472,"title":"Formatter is inconsistent about aligning comments","user":{"login":"leafpetersen","id":8484504,"avatar_url":"https://avatars.githubusercontent.com/u/8484504?v=3","gravatar_id":"","url":"https://api.github.com/users/leafpetersen","html_url":"https://github.com/leafpetersen","followers_url":"https://api.github.com/users/leafpetersen/followers","following_url":"https://api.github.com/users/leafpetersen/following{/other_user}","gists_url":"https://api.github.com/users/leafpetersen/gists{/gist_id}","starred_url":"https://api.github.com/users/leafpetersen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leafpetersen/subscriptions","organizations_url":"https://api.github.com/users/leafpetersen/orgs","repos_url":"https://api.github.com/users/leafpetersen/repos","events_url":"https://api.github.com/users/leafpetersen/events{/privacy}","received_events_url":"https://api.github.com/users/leafpetersen/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dart-lang/dart_style/labels/as%20designed","name":"as designed","color":"eee8d5"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-12-01T21:06:37Z","updated_at":"2015-12-03T02:14:49Z","closed_at":"2015-12-03T02:14:49Z","body":"The example below contains three comments with an unaligned line.  The formatter re-aligns the middle one but not the other two.  Is this intentional?  I'd love it to align comments for me, and it seems to do so for the `//` style comments, but it's surprising to have it do some but not others.\r\n\r\n```dart\r\nclass A {\r\n/**\r\n   * Comment doesn't get aligned\r\n   */\r\n  int get foo => 3;\r\n\r\n /**\r\n   * Comment gets aligned\r\n   */\r\n  int get bar => 3;\r\n\r\n  /**\r\n * Comment doesn't get aligned\r\n   */\r\n  int get baz => 3;\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/dart-lang/dart_style/issues/comments/161495162","html_url":"https://github.com/dart-lang/dart_style/issues/472#issuecomment-161495162","issue_url":"https://api.github.com/repos/dart-lang/dart_style/issues/472","id":161495162,"user":{"login":"munificent","id":46275,"avatar_url":"https://avatars.githubusercontent.com/u/46275?v=3","gravatar_id":"","url":"https://api.github.com/users/munificent","html_url":"https://github.com/munificent","followers_url":"https://api.github.com/users/munificent/followers","following_url":"https://api.github.com/users/munificent/following{/other_user}","gists_url":"https://api.github.com/users/munificent/gists{/gist_id}","starred_url":"https://api.github.com/users/munificent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/munificent/subscriptions","organizations_url":"https://api.github.com/users/munificent/orgs","repos_url":"https://api.github.com/users/munificent/repos","events_url":"https://api.github.com/users/munificent/events{/privacy}","received_events_url":"https://api.github.com/users/munificent/received_events","type":"User","site_admin":false},"created_at":"2015-12-03T02:14:49Z","updated_at":"2015-12-03T02:14:49Z","body":"Ah, yes. There's one other wrinkle I didn't mention. :)\r\n\r\nThe formatter also has a rule that if a comment starts at column 0, then it is not reindented. This is to ensure commented out code is not \"fixed\" by having indentation applied to it. It would be annoying if the formatter took code like:\r\n\r\n```dart\r\nif (something) {\r\n  while (anotherThing) {\r\n    doStuff();\r\n\r\n//    brokenStuff();\r\n//    moreBrokenStuff();\r\n\r\n    moreStuff();\r\n  }\r\n}\r\n```\r\n\r\nand \"corrected\" it to:\r\n\r\n```dart\r\nif (something) {\r\n  while (anotherThing) {\r\n    doStuff();\r\n\r\n    //    brokenStuff();\r\n    //    moreBrokenStuff();\r\n\r\n    moreStuff();\r\n  }\r\n}\r\n```\r\n\r\nIf you add *one* space before the `/**` on `foo`, then you'll see that it does fix its indentation after that.\r\n"}}