Adds a ForbiddenSingleExpressionSyntax rule#3550
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3550 +/- ##
=========================================
Coverage 77.53% 77.54%
- Complexity 2829 2839 +10
=========================================
Files 464 465 +1
Lines 8769 8790 +21
Branches 1713 1719 +6
=========================================
+ Hits 6799 6816 +17
Misses 1046 1046
- Partials 924 928 +4
Continue to review full report at Codecov.
|
We talked about this a lot of times in different issues. We need a controversial ruleset. But I also like this rule a lot. And I know other devs that don't like the overuse of this feature either.
We can open a new issue about this topix. I think that we should enable ktlint in this project. I have the same issue autoformatting some rules that it changes far too much lines. |
| Debt.FIVE_MINS | ||
| ) | ||
|
|
||
| @Suppress("ReturnCount") |
There was a problem hiding this comment.
This suppression shouldn't be necessary, since the guard clause having a return statement are excluded.
I suggested this in a few PRs as well. +1 from my side. |
9b9f2df to
c510158
Compare
|
How about I at least add a |
|
Great idea!!! Yes! We can add the rules in any ruleset but we can mark them as controversial! I think that we can make a new issue to implement this idea and merge this directly. The annotation is a better solution and it is not a breaking change so we can even mark old rules. Win-win! |
53198e5 to
609f4b5
Compare
|
I think this is obsolete as there is already a |
closes #1675
While trying to find a reference for the rule documentation, I realized that there does not seem to be agreement about this in the community. I guess this will never become a rule that is turned on be default.
While I personally like the rule, I am wondering if detekt should even be so opinionated about things that are not part of the official coding conventions or guidelines.
And then I may have formatting issues (again). Opening any other rule class causes the ktlint plugin to report an error such as
Unexpected indentation (20) (should be 12) (indent). Any help will be greatly appreciated.