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

Print filtered paths in debug mode #869

Closed
kenyee opened this issue Apr 18, 2018 · 4 comments · Fixed by #3022
Closed

Print filtered paths in debug mode #869

kenyee opened this issue Apr 18, 2018 · 4 comments · Fixed by #3022

Comments

@kenyee
Copy link
Contributor

kenyee commented Apr 18, 2018

Expected Behavior

I didn't see this reported yet...when you run detektCheck, it just says "build successful" and reports no output

Current Behavior

Should output a report to the shell when running from command line

Steps to Reproduce (for bugs)

I did have to change the exclusions as mentioned here: #792
Before that, it was randomly showing 0 files analyzed. After changing the exclusion it found the unit test files and flagged a few issues. I reconfigured detekt.yml to work around those issues but then it reported nothing (doesn't say 0 files found either).

Top level build.gradle file config looks like:
detekt {
version = "${detektVersion}"
profile("main") {
input = "$projectDir/app/src"
config = "$projectDir/detekt.yml"
filters = ".test.,./resources/.,./tmp/."
}
}
with this in the plugins list:
id "io.gitlab.arturbosch.detekt" version "1.0.0.RC6-4"
detekt.yml file is just the one generated w/ "gradle detektGenerateConfig" and copied to detekt.yml at the project root.

Context

Doesn't allow Detekt to run in our project. Would like to use it in addition to ktlint.
There should be a debug flag in the detekt build.gradle config closure IMHO....

Your Environment

  • Version used: 1.0.0.RC6-4
  • Operating System and version: OSX High Sierra
  • Link to your project:
@arturbosch
Copy link
Member

I assume this is solved as you mentioned it in #792? Feel free to reopen if you still have questions or problems.

@kenyee
Copy link
Contributor Author

kenyee commented Apr 21, 2018

@arturbosch:
Thanks for making me run it clarify in #792.
The issue was the detekt.yml file was using the same test filter that is wrong (mentioned in 792).
And it's super weird that it's in the build.gradle config includes a list of excludes and it's also in the detekt.yml file.

And I still wish the build.gradle config for detekt had a debug mode. The debug mode should show which files it auto filtered out IMHO.

@arturbosch
Copy link
Member

arturbosch commented Apr 24, 2018

Hm, good idea, I will reopen the issue with other name.
But the test-pattern just filters some of the rules which should not be run on test code but not all rules hmmm
Edit: Ps: we have a debug mode detekt { debug = true } which prints the used profile, config and laoded extensions.

@arturbosch arturbosch changed the title running detektCheck just says "build successful" and doesn't provide any output Print filtered paths in debug mode Apr 24, 2018
@arturbosch arturbosch reopened this Apr 24, 2018
@kenyee
Copy link
Contributor Author

kenyee commented Apr 24, 2018

Apparently the test-pattern affects things like the exclude list in the config 😀

If you add the exclusions that to that debug=true mode, that would help...and document that flag please 😃

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

Successfully merging a pull request may close this issue.

2 participants