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

Noisy gradle #3655

Merged
merged 3 commits into from
Apr 8, 2021
Merged

Noisy gradle #3655

merged 3 commits into from
Apr 8, 2021

Conversation

BraisGabin
Copy link
Member

@BraisGabin BraisGabin commented Apr 5, 2021

Fix #3019

The JVM and the Android tasks are sending non-kotlin files as input to the client. This was configured properly in Plain detekt but not in the others. This PR fixes that.

Ignoring a file detekt cannot handle: /Users/brais.gabin/ranom/path/AClass.java

This PR was originally opened here #3648 but I messed up with a merge and it end up closed automatically.

@codecov
Copy link

codecov bot commented Apr 5, 2021

Codecov Report

Merging #3655 (85fda07) into main (709f879) will not change coverage.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##               main    #3655   +/-   ##
=========================================
  Coverage     78.12%   78.12%           
  Complexity     2837     2837           
=========================================
  Files           467      467           
  Lines          9143     9143           
  Branches       1737     1737           
=========================================
  Hits           7143     7143           
  Misses         1058     1058           
  Partials        942      942           
Impacted Files Coverage Δ Complexity Δ
...kotlin/io/gitlab/arturbosch/detekt/DetektPlugin.kt 6.25% <ø> (+0.25%) 0.00 <0.00> (ø)
...o/gitlab/arturbosch/detekt/internal/DetektPlain.kt 0.00% <ø> (ø) 0.00 <0.00> (ø)
...o/gitlab/arturbosch/detekt/internal/SharedTasks.kt 0.00% <0.00%> (ø) 0.00 <0.00> (ø)

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 709f879...85fda07. Read the comment docs.

Copy link
Member

@chao2zhang chao2zhang left a comment

Choose a reason for hiding this comment

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

Thank you for fixing this!
(I left a comment but feel free to drop, the DslGradleRunner is a bit messy when I read the code even before this PR)

.writeText("public class ${name}Test {}")
}

fun DslGradleRunner.createJavaClass(submodule: Submodule, name: String) {
Copy link
Member

Choose a reason for hiding this comment

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

For these extension methods - Do we think it would be better to modularize as:
fun DslGradleRunner.findMainSrcDir()
fun DslGradleRunner.findTestSrcDir()
fun Submodule.findMainSrcDir()
fun Submodule.findTestSrcDir()
and
fun writeJavaFile()

It might be confusing to have createJavaClass() write to both main and test.

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree... I think that we should not have a difference between module and submodule. Both hae the same features. This DSL needs a refactor but I'm not sure if it's worth it.

Copy link
Member Author

Choose a reason for hiding this comment

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

I can't implement this:

fun Submodule.findMainSrcDir()
fun Submodule.findTestSrcDir()

Because a Submodule doesn't have the information about DslGradleRunner and I need the DslGradleRunner to get the base path.

I'd vote to merge this and if you think that we should rethinkg the DslGradleRunner we can open an issue and see how can we refactor it.

Copy link
Member

Choose a reason for hiding this comment

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

We probably just need housekeeping work on DslGradleRunner

@chao2zhang chao2zhang added this to the 1.17.0 milestone Apr 5, 2021
@chao2zhang chao2zhang merged commit 2c4b6fb into main Apr 8, 2021
@chao2zhang chao2zhang deleted the noisy-gradle branch April 8, 2021 23:42
BraisGabin added a commit that referenced this pull request May 17, 2021
cortinico pushed a commit that referenced this pull request May 19, 2021
cortinico pushed a commit to cortinico/detekt that referenced this pull request May 19, 2021
cortinico pushed a commit that referenced this pull request May 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

detektMain is noisy "Ignoring a file detekt cannot handle"
2 participants