Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a fix for the always_put_control_body_on_new_line lint #47956

Open
bwilkerson opened this issue Dec 16, 2021 · 1 comment
Open

Add a fix for the always_put_control_body_on_new_line lint #47956

bwilkerson opened this issue Dec 16, 2021 · 1 comment
Labels
analyzer-diagnostic-without-fix analyzer-quick-fix area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. contributions-welcome Contributions welcome to help resolve this (the resolution is expected to be clear from the issue) P3 A lower priority bug or feature request type-enhancement A request for a change that isn't a bug

Comments

@bwilkerson
Copy link
Member

It would be good to have a fix for the always_put_control_body_on_new_line lint.

It's possible that the fix would conflict with the formatter, in which case this might want to wait until we have a way to know whether the formatter is being used so that we can provide a fix that the formatter won't undo.

@bwilkerson bwilkerson added area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. analyzer-quick-fix labels Dec 16, 2021
@srawlins srawlins added P3 A lower priority bug or feature request type-enhancement A request for a change that isn't a bug labels Dec 20, 2021
@srawlins srawlins added the contributions-welcome Contributions welcome to help resolve this (the resolution is expected to be clear from the issue) label May 20, 2022
@bsutton
Copy link

bsutton commented May 22, 2023

Just a follow-up on this.
I have the formatter enabled and it does not appear to conflict with a possible fix for this lint.

If I have the code:

if (true) print('hi');

To fix it, I place a new line before the print

if (true) 
print('hi');

When I save the formatter then kicks in and replaces it with:

    if (true) {
      print('hi');
    }

My understanding is that the formatter isn't configurable, so I assume all users will see the same behaviour.

As such, if a fix for this lint generated the final form (above) then we have a working fix that doesn't conflict with the formatter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-diagnostic-without-fix analyzer-quick-fix area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. contributions-welcome Contributions welcome to help resolve this (the resolution is expected to be clear from the issue) P3 A lower priority bug or feature request type-enhancement A request for a change that isn't a bug
Projects
Development

No branches or pull requests

4 participants