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

How to disable a specific rule with new version? #329

Closed
dessalines opened this issue May 16, 2023 · 6 comments
Closed

How to disable a specific rule with new version? #329

dessalines opened this issue May 16, 2023 · 6 comments

Comments

@dessalines
Copy link

I updated kotlinter, but there are no instructions for how to disable specific lints.

@jeremymailen
Copy link
Owner

This is covered in ktlint's configuration guide here: https://pinterest.github.io/ktlint/0.49.1/rules/configuration-ktlint/#disabled-rules

@dessalines
Copy link
Author

That doesn't show how I add any of those rules to kotlinter. In the gradle config block somehow?

@jeremymailen
Copy link
Owner

You put them in the .editorconfig file.

@dessalines
Copy link
Author

dessalines commented May 16, 2023

Support of properties disabled_rules and ktlint_disabled_rules has been removed in KtLint 0.49.

I tried that, but couldn't get any of them to work with kotlinter

@jeremymailen
Copy link
Owner

As shown in their documentation syntax like the following will work

ktlint_standard_final-newline = disabled

There is a bug where sometimes we cache and don't immediately see an .editorconfig change (#327) so you may wish to gradle --stop after your edit just to be sure.

@dessalines
Copy link
Author

Thanks! This worked in my .editorconfig

[*.{kt,kts}]
ktlint_standard_no-wildcard-imports = disabled

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

2 participants