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

detektMain is noisy "Ignoring a file detekt cannot handle" #3019

Closed
BraisGabin opened this issue Aug 26, 2020 · 5 comments · Fixed by #3361 or #3655
Closed

detektMain is noisy "Ignoring a file detekt cannot handle" #3019

BraisGabin opened this issue Aug 26, 2020 · 5 comments · Fixed by #3361 or #3655

Comments

@BraisGabin
Copy link
Member

Expected Behavior

This kind of messages doesn't appear

> Task :common:core:detektDebugUnitTest
Ignoring a file detekt cannot handle: /Users/brais.gabin/projects/XXXXX/Class.java

Current Behavior

If I run ./gradlew detekt this messages never appear. But if I run ./gradlew detektMain or ./gradlew detektTest they do appear.

Context

Now that we have support to Android variants I'm moving my detekt configuration to use detektMain instead of detekt so I can use Type resolutions

@arturbosch
Copy link
Member

Similar warnings with classpath entries:

> Task :detekt-core:detektMain
warning: classpath entry points to a non-existent location: /home/artur/git/repos/detekt/detekt-metrics/build/classes/java/main
warning: classpath entry points to a non-existent location: /home/artur/git/repos/detekt/detekt-tooling/build/classes/java/main
warning: classpath entry points to a non-existent location: /home/artur/git/repos/detekt/detekt-api/build/classes/java/main
warning: classpath entry points to a non-existent location: /home/artur/git/repos/detekt/detekt-parser/build/classes/java/main
warning: classpath entry points to a non-existent location: /home/artur/git/repos/detekt/detekt-psi-utils/build/classes/java/main
warning: classpath entry points to a non-existent location: /home/artur/git/repos/detekt/detekt-report-html/build/classes/java/main
warning: classpath entry points to a non-existent location: /home/artur/git/repos/detekt/detekt-report-txt/build/classes/java/main
warning: classpath entry points to a non-existent location: /home/artur/git/repos/detekt/detekt-report-xml/build/classes/java/main

@arturbosch
Copy link
Member

arturbosch commented Aug 26, 2020

I think this line results into the whole src/main/kotlin directory instead of a set of kotlin files like the plain detekt task does.
No the Gradle task must pass really plain java files to core.

This warning is from detekt-core. We could change info to debug:

settings.info("Ignoring a file detekt cannot handle: $path")

We should just pass kotlin files from gradle to core.

@Jacks0N23
Copy link

The original issue is still there at 1.16.0-RC2

@cortinico cortinico reopened this Mar 3, 2021
@cortinico
Copy link
Member

@Jacks0N23 Can you provide a reproducer? Also is the issue happening only with Type Resolution or also with the plain detekt task?

@Jacks0N23
Copy link

Jacks0N23 commented Mar 4, 2021

I have a production project with many modules
some of them contains java and kotlin code in common src/main/java source set
every module have connected configured detekt plugin
when I'm run detekt or detektMain or detektBaseline I see many lines like:

Ignoring a file detekt cannot handle: /Users/me/StudioProjects/myProject/sources/commons/common-dao/src/main/java/my/company/package/common_dao/DaoUtils.java
and so on…

also I saw files from res/ folder. Yes, I could exclude those packages, but why detekt doesn't filter them at configuration?
Also I would notice that I have default input param, didn't override it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants