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

Apply Custom Rules YML voids all rules #387

Open
kingargyle opened this issue Nov 16, 2022 · 4 comments
Open

Apply Custom Rules YML voids all rules #387

kingargyle opened this issue Nov 16, 2022 · 4 comments

Comments

@kingargyle
Copy link

With the latest plugin in Android Studio Dolphin, if I try to add a configuration file yml, and apply it. It appears that the rules are not applied and not even the default rules. This can be replicated simply enough by taking the default configuration file from:

https://raw.githubusercontent.com/detekt/detekt/main/detekt-core/src/main/resources/default-detekt-config.yml

And adding it as a Configuration file. Apply it, and then go to a file that you know has rules violations. No detekt rules are shown.

If you remove the file, and just go with the default from the plugin, then those rules are available and are applied as expected.

Add the custom rules back in and no detekt rules are shown.

@rdoupe
Copy link

rdoupe commented Nov 16, 2022

I just did the same thing, and I'm seeing the same results with Intellij Ultimate 2022.2.3

@rdoupe
Copy link

rdoupe commented Nov 16, 2022

I was able to get this working by using "Build rules upon default configuration"
image

and the following detekt.yml which overrides maxIssues and MaxLineLength

build:
  maxIssues: 99999

style:
  MaxLineLength:
    active: true
    maxLineLength: 140
    excludePackageStatements: true
    excludeImportStatements: true
    excludeCommentStatements: false
    excludeRawStrings: true

this will work for me, but it's not ideal that it doesn't work with the default config.

I also had to restart Intellij for the plugin to detekt the changes.

@jack-webb
Copy link

I'm seeing the same issue in AS Dolphin, plugin version 1.21.3-android. The above fix didn't work for me, though.

@adrianlandborn
Copy link

I still have the same issue.
We have maxLineLength: 140 but the plugin still complains if we go past 120.

Any updates or workarounds?

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

No branches or pull requests

4 participants