-
Notifications
You must be signed in to change notification settings - Fork 451
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
Reducible #215
Reducible #215
Conversation
Codecov Report
@@ Coverage Diff @@
## master #215 +/- ##
=========================================
Coverage ? 50.44%
Complexity ? 206
=========================================
Files ? 101
Lines ? 2266
Branches ? 276
=========================================
Hits ? 1143
Misses ? 1011
Partials ? 112
Continue to review full report at Codecov.
|
dfcb9c4
to
9345d19
Compare
detekt.yml
Outdated
@@ -84,7 +84,7 @@ formatting: | |||
active: true | |||
autoCorrect: true | |||
ExpressionBodySyntaxLineBreaks: | |||
active: true | |||
active: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm the waterparties here. The detek baseline will need to be regenerated and the long lines fixed if this is not enforced anymore :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could enable it again, but detekt was not allowing me to compile in any way (tried many workarounds) because of format requirement collisions on 2 different rules (I think it was this one and MaxLineLength). I didn't have any other choice than disabling this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ExpressionBodySyntaxLineBreaks is an auto-fix that's bugged. Instead of applying to every instance, it only applies to the first one per file. You have to run it multiple times to make it work.
Once those errors are gone, you'll get a lot of MaxLineLength ones. For that you just regenerate the baseline with ./gradlew detektEstablishAcceptedErrors
and push
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The train of thought is that autofix > MaxLineLength + regenerate baseline, for consistency purposes. It's quite annoying for now, so reverting would mean fixing all the MaxLineLength back. No more than 30 minutes to do it tho.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. I've done what we agreed on in slack for this PR:
- Auto-fixed ExpressionBodySyntaxLineBreaks violations with
./gradlew detekt
(running it multiple times). - When I just had a few
MaxLineLength
violations I regenerated baseline with./gradlew detektEstablishAcceptedErrors
.
Fixes #211
Reducible
andNonEmptyReducible
instance.Reducible
laws.Reducible
andReducibleLaws
.