Skip to content
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

Active rules by default #4875

Merged
merged 1 commit into from Jun 1, 2022
Merged

Active rules by default #4875

merged 1 commit into from Jun 1, 2022

Conversation

BraisGabin
Copy link
Collaborator

@BraisGabin BraisGabin commented May 30, 2022

This PR enables the rules as we talk in #4643.

If, to help with the changelog, creating one PR for each rule helps I can create those ~30PRs. I would create a script or somthing to do it. But I prefer to avoid it.

Enabled rules:

  • InjectDispatcher
  • RedundantSuspendModifier
  • SleepInsteadOfDelay
  • SuspendFunWithFlowReturnType
  • InstanceOfCheckForException
  • InvalidPackageDeclaration
  • NoNameShadowing
  • AvoidReferentialEquality
  • DoubleMutabilityForCollection
  • HasPlatformType
  • IgnoredReturnValue
  • MapGetWithNotNullAssertionOperator
  • MissingPackageDeclaration (see Prepare 1.21.0-RC1 #4900 & 87f32e1)
  • UnreachableCatchBlock
  • UnusedUnaryOperator
  • UselessPostfixExpression
  • DestructuringDeclarationWithTooManyEntries
  • ExplicitItLambdaParameter
  • ForbiddenVoid
  • ObjectLiteralToLambda
  • RedundantHigherOrderMapUsage
  • UnnecessaryFilter
  • UseAnyOrNoneInsteadOfFind
  • UseArrayLiteralsInAnnotations
  • UseCheckNotNull
  • UseCheckOrError
  • UseIsNullOrEmpty
  • UseOrEmpty
  • UseRequire
  • UseRequireNotNull

Closes #4643

@BraisGabin BraisGabin added the notable changes Marker for notable changes in the changelog label May 30, 2022
@github-actions github-actions bot added the rules label May 30, 2022
@codecov
Copy link

codecov bot commented May 30, 2022

Codecov Report

Merging #4875 (67f95b6) into main (233b4a6) will increase coverage by 0.07%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##               main    #4875      +/-   ##
============================================
+ Coverage     84.80%   84.87%   +0.07%     
- Complexity     3463     3471       +8     
============================================
  Files           493      493              
  Lines         11353    11353              
  Branches       2089     2089              
============================================
+ Hits           9628     9636       +8     
  Misses          674      674              
+ Partials       1051     1043       -8     
Impacted Files Coverage Δ
...rbosch/detekt/rules/coroutines/InjectDispatcher.kt 86.36% <ø> (+4.54%) ⬆️
...etekt/rules/coroutines/RedundantSuspendModifier.kt 65.11% <ø> (+2.32%) ⬆️
...sch/detekt/rules/coroutines/SleepInsteadOfDelay.kt 76.66% <ø> (+3.33%) ⬆️
...t/rules/coroutines/SuspendFunWithFlowReturnType.kt 84.00% <ø> (+4.00%) ⬆️
...osch/detekt/rules/bugs/AvoidReferentialEquality.kt 92.00% <ø> (ø)
...detekt/rules/bugs/DoubleMutabilityForCollection.kt 93.54% <ø> (+3.22%) ⬆️
...ab/arturbosch/detekt/rules/bugs/HasPlatformType.kt 72.00% <ø> (+4.00%) ⬆️
...arturbosch/detekt/rules/bugs/IgnoredReturnValue.kt 82.85% <ø> (ø)
...t/rules/bugs/MapGetWithNotNullAssertionOperator.kt 81.25% <ø> (ø)
...sch/detekt/rules/bugs/MissingPackageDeclaration.kt 92.85% <ø> (ø)
... and 28 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 233b4a6...67f95b6. Read the comment docs.

@cortinico
Copy link
Member

cortinico commented May 31, 2022

If, to help with the changelog, creating one PR for each rule helps I can create those ~30PRs. I would create a script or somthing to do it. But I prefer to avoid it.

Not really. Let's add it to the notable changes and I'll add a line about it.

@cortinico cortinico added this to the 1.21.0 milestone May 31, 2022
@BraisGabin BraisGabin requested a review from marschwar Jun 1, 2022
Copy link
Contributor

@marschwar marschwar left a comment

Isn't it beautiful how you just have to add the annotation and the config and documentation are in sync. I ❤️ it.

Thanks for doing all the leg work.

@BraisGabin BraisGabin merged commit 6d2933d into main Jun 1, 2022
20 checks passed
@BraisGabin BraisGabin deleted the fix-4643 branch Jun 1, 2022
@cortinico
Copy link
Member

cortinico commented Jun 2, 2022

I had to disable the MissingPackageDeclaration in order for 1.21.0-RC1 to be released.

The problem with this rule is that we're creating files in the default package (src/main/java) without a package definition inside our Gradle Plugin Tests. I also think that having files without a package declaration is fine as long as they stay in the correct folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
notable changes Marker for notable changes in the changelog rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable rules by default for 1.21
4 participants