Contradicting Rules 1107 and 1108

Operating system: Windows
SonarLint plugin version: 7.4.0.60471
Programming language you’re coding in: Java
Is connected mode used: Yes

  • Connected SonarQube Community Version

Rules 1107 and 1108 are both contradicting each other.
Rule 1107 says : Closing curly brace and next “else”,“catch” or “finally” keywords should be located on the same line.
Rule 1108 says : Closing curly brace and next “else”,“catch” or “finally” keywords should be on two different lines.

Hi,

Welcome to the community!

Yes, we have a couple of these pairs. We provide both sides of the coin because different teams have different standards. We don’t turn those rules on by default; it’s up to you to pick the right one & enable it in your profile - if you choose.

 
HTH,
Ann

1 Like