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

Include detekt-rules on CLI runtime classpath #3625

Merged
merged 1 commit into from
Mar 29, 2021
Merged

Conversation

3flex
Copy link
Member

@3flex 3flex commented Mar 29, 2021

Removing detekt-rules from the CLI runtime classpath in #3611 caused some issues with Gradle's up-to-date & dependency checks and made the build behave strangely when running detekt tasks on the project (rule changes weren't being picked up when the detekt task ran).

This fixes that problem.

I also seem to have to restart the Gradle daemon when making rule changes for that to be picked up on new detekt runs - I suspect the class loader cache but I don't know enough about it, or if this is a new issue or not.

@codecov
Copy link

codecov bot commented Mar 29, 2021

Codecov Report

Merging #3625 (6a94d99) into main (84009f2) will increase coverage by 0.68%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #3625      +/-   ##
============================================
+ Coverage     77.56%   78.25%   +0.68%     
  Complexity     2829     2829              
============================================
  Files           465      466       +1     
  Lines          8807     9136     +329     
  Branches       1720     1724       +4     
============================================
+ Hits           6831     7149     +318     
- Misses         1047     1059      +12     
+ Partials        929      928       -1     
Impacted Files Coverage Δ Complexity Δ
...io/gitlab/arturbosch/detekt/core/BindingContext.kt 5.26% <0.00%> (-0.99%) 0.00% <0.00%> (ø%)
...lab/arturbosch/detekt/generator/collection/Rule.kt 92.85% <0.00%> (-0.48%) 9.00% <0.00%> (-1.00%)
...ls/src/main/kotlin/io/github/detekt/psi/KtFiles.kt 75.00% <0.00%> (ø) 0.00% <0.00%> (ø%)
...ain/kotlin/io/gitlab/arturbosch/detekt/cli/Spec.kt 82.00% <0.00%> (ø) 0.00% <0.00%> (ø%)
.../kotlin/io/gitlab/arturbosch/detekt/cli/CliArgs.kt 100.00% <0.00%> (ø) 3.00% <0.00%> (ø%)
.../main/kotlin/io/gitlab/arturbosch/detekt/Detekt.kt 0.00% <0.00%> (ø) 0.00% <0.00%> (ø%)
...n/kotlin/io/gitlab/arturbosch/detekt/rules/Junk.kt 53.33% <0.00%> (ø) 0.00% <0.00%> (ø%)
...in/kotlin/io/github/detekt/report/xml/XmlEscape.kt 64.28% <0.00%> (ø) 3.00% <0.00%> (ø%)
.../io/gitlab/arturbosch/detekt/cli/Configurations.kt 0.00% <0.00%> (ø) 0.00% <0.00%> (ø%)
...n/kotlin/io/github/detekt/report/sarif/SarifDsl.kt 100.00% <0.00%> (ø) 0.00% <0.00%> (ø%)
... and 176 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 84009f2...6a94d99. Read the comment docs.

@BraisGabin
Copy link
Member

I also seem to have to restart the Gradle daemon when making rule changes for that to be picked up on new detekt runs - I suspect the class loader cache but I don't know enough about it, or if this is a new issue or not.

That's a known issue.


testImplementation(project(":detekt-test"))

bundledRules(project(":detekt-rules"))
}

tasks.shadowJar {
mergeServiceFiles()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you confirm that the shadowJar will include :detekt-rules?

Copy link
Member Author

@3flex 3flex Mar 29, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not manually but it's just going back to the old config. Shadow task bundles everything in runtime classpath by default.

@3flex 3flex merged commit 0e680c4 into detekt:main Mar 29, 2021
@cortinico cortinico added this to the 1.17.0 milestone May 1, 2021
@cortinico cortinico added the housekeeping Marker for housekeeping tasks and refactorings label May 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
housekeeping Marker for housekeeping tasks and refactorings
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants