Skip to content

Noisy gradle#3655

Merged
picklebento merged 3 commits intomainfrom
noisy-gradle
Apr 8, 2021
Merged

Noisy gradle#3655
picklebento merged 3 commits intomainfrom
noisy-gradle

Conversation

@BraisGabin
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
Member

@picklebento picklebento 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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

@picklebento picklebento added this to the 1.17.0 milestone Apr 5, 2021
@picklebento picklebento merged commit 2c4b6fb into main Apr 8, 2021
@picklebento picklebento 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