Modify rule S121: Control structures should use curly braces (curly_braces_in_flow_control_structures)

This commit is contained in:
Antonio Aversa 2024-07-22 16:01:43 +02:00
parent a9dbd9f246
commit d173dfb031

View File

@ -1,5 +1,34 @@
include::../rule.adoc[]
=== Exceptions
The rule does not apply to single-line `if` statements. It does apply, however, to single-line `for`, `while` and `do while` statements.
== Resources
* https://dart.dev/tools/linter-rules/curly_braces_in_flow_control_structures[Dart Lint rule]
* Dart Docs - https://dart.dev/tools/linter-rules/curly_braces_in_flow_control_structures[Dart Linter rule - curly_braces_in_flow_control_structures]
* Dart Docs - https://dart.dev/language/loops[Dart language - Control flow - Loops]
* Dart Docs - https://dart.dev/language/branches[Dart language - Control flow - Branches]
* Wikipedia - https://en.wikipedia.org/wiki/Dangling_else[Dangling else]
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Statements in a [if|for|while|do] should be enclosed in a block.
=== Highlighting
The body of the [if|for|while|do] statement, including the statement-ending `;`.
'''
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]