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

Lint to use curly bodies for statements except one-line ifs (Style Guide). #57151

Closed
pq opened this issue Feb 4, 2015 · 3 comments
Closed

Lint to use curly bodies for statements except one-line ifs (Style Guide). #57151

pq opened this issue Feb 4, 2015 · 3 comments
Labels
analyzer-linter Issues with the analyzer's support for the linter package area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. good first issue A good starting issue for contributors (issues with this label will appear in /contribute) linter-lint-request type-enhancement A request for a change that isn't a bug

Comments

@pq
Copy link
Member

pq commented Feb 4, 2015

Migrated from dartbug.com/22001:

Should warn or fix if a for, while, or else clause does not have a curly brace body. It should also flag the then clause of an if if it doesn't fit on a single line.

@pq pq added the type-enhancement A request for a change that isn't a bug label Feb 4, 2015
@pq pq changed the title Use curly bodies for statements except one-line ifs Lint to use curly bodies for statements except one-line ifs (Style Guide). Feb 7, 2015
@pq pq self-assigned this Feb 7, 2015
@seaneagan
Copy link

Does this issue include a "quick fix" to convert overlong one-line if statements to block statements?

@pq
Copy link
Member Author

pq commented Apr 28, 2015

I've been treating lint warnings and fixes as separate requests but maybe we should consolidate. In any event, your comment is timely because my current focus is getting the linter plugged into the analysis server which is the key to getting fixes implemented (#87) . Stay tuned!

@pq
Copy link
Member Author

pq commented Sep 4, 2019

My sense is this one is largely subsumed by curly_braces_in_flow_control_structures which is enabled in package:pedantic.

We can re-open if anyone feels strongly otherwise...

@pq pq closed this as completed Sep 4, 2019
@devoncarew devoncarew added analyzer-linter Issues with the analyzer's support for the linter package area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. labels Nov 18, 2024
@devoncarew devoncarew transferred this issue from dart-lang/linter Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-linter Issues with the analyzer's support for the linter package area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. good first issue A good starting issue for contributors (issues with this label will appear in /contribute) linter-lint-request type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

4 participants