Open oheyadam opened 4 months ago
Includes/excludes applies filters to the paths passed to source
- you should pass the files you wish to scan to that parameter.
Includes/excludes applies filters to the paths passed to
source
- you should pass the files you wish to scan to that parameter.
Sorry I failed to mention that I have a global Detekt config block that passes the source. Also doesn't detekt have a default value for this anyway?
I already have the following:
tasks.withType<Detekt>.configureEach {
setSource(project.layout.projectDirectory)
}
Typing down this code on my phone, so it might be wrong, but you get the idea. I even copied this over to my custom task and it still doesn't work.
Can you please put a self contained reproducer together? That will make it much easier to have a look at what's going on.
Hey @3flex, just wanted to add another thing I noticed. In the same project structure that I linked, the detektBaseline
function doesn't seem to work. Every time you invoke it, it just generates an empty file, even if you have new issues in your project.
What's wrong here? Does Detekt just not play nice when used in included builds?
Expected Behavior
I have this custom detekt task to which I pass only the files that were changed because I don't want to run full
detekt
. I'm passing the files via include(). I expect it to run against this subset of files onlyObserved Behavior
Running the task with
`--info
says it hasNO-SOURCE
, even though I am passing a list of files.Steps to Reproduce
Create the task as such:
GitChangedFilesValueSource
is defined as such:Run
./gradlew fastDetekt
, it always succeeds even if you intentionally break some detekt rules in any of your filesContext
Your Environment
--scan
option when running the gradle task):