28 lines
817 B
Plaintext
28 lines
817 B
Plaintext
=== on 6 Mar 2018, 17:22:14 Tibor Blenessy wrote:
|
|
Go requires curly braces for conditional statements.
|
|
|
|
=== on 8 Jun 2018, 17:52:10 Duncan Pocklington wrote:
|
|
This rule seems to overlap almost completely with https://jira.sonarsource.com/browse/RSPEC-2681[S2681]
|
|
|
|
|
|
Given the non-compliant example:
|
|
|
|
|
|
----
|
|
if (condition) // Noncompliant
|
|
doTheThing();
|
|
doTheOtherThing(); // <- S2681 "This line will not be executed conditionally; only the first line of this 3-line block will be ..."
|
|
somethingElseEntirely();
|
|
|
|
foo();
|
|
----
|
|
|
|
Fixing the indentation or using blocks stops S2681 from raising. Do we need both rules?
|
|
|
|
|
|
\[UPDATE] The wording of this rule and S2681 and examples have been updated.
|
|
|
|
=== on 1 Feb 2019, 10:31:32 Amaury Levé wrote:
|
|
Adding VB.NET and VB6 as irrelevant because by design you always have a block.
|
|
|