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

Empty custom config enables rules disabled by default #3379

Closed
krzema12 opened this issue Jan 15, 2021 · 1 comment · Fixed by #3380
Closed

Empty custom config enables rules disabled by default #3379

krzema12 opened this issue Jan 15, 2021 · 1 comment · Fixed by #3380
Labels
Milestone

Comments

@krzema12
Copy link

Expected Behavior

When I create an empty custom config file and enable it though detekt { config ... }, it should work as if the custom config wasn't enabled.

Observed Behavior

My Gradle config is as follows:

detekt {
    buildUponDefaultConfig = true
    config = files("$projectDir/detekt-custom-config.yml")
}

and the config file is empty. When I run Detekt, I'm getting

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':backend:detekt'.
> Rule 'AbsentOrWrongFileLicense': License template file not found at `/home/piotr/repos/teams/backend/license.template`.
  Create file license header file or check your running path.

I customized one rule that I needed and it now seems to work correctly.

Steps to Reproduce

See above.

Context

This issue caused confusion as the behavior is counter-intuitive, or if it's somehow by design, it's not documented well enough.

Your Environment

  • Version of detekt used: 1.15.0
  • Version of Gradle used (if applicable): 6.6.1
  • Operating System and version: Ubuntu 20.04
  • Link to your project (if it's a public repository): (private repo - easy to reproduce given above description)
@krzema12
Copy link
Author

Thank you for the express fix!

@arturbosch arturbosch added this to the 1.16.0 milestone Jan 18, 2021
This was referenced Mar 11, 2021
This was referenced Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants