disabled-rules for ktlint in .editorconfig is ignored
See original GitHub issueSince 0.34, ktlint supports disabling rules globally with a setting in the .editorconfig
file:
# Comma-separated list of rules to disable (Since 0.34.0)
# Note that rules in any ruleset other than the standard ruleset will need to be prefixed
# by the ruleset identifier.
disabled_rules=no-wildcard-imports,experimental:annotation,my-custom-ruleset:my-custom-rule
(see https://github.com/pinterest/ktlint#custom-editorconfig-properties)
It seems like kotlinter does not pick up that configuration setting and it has to be repeated in the corresponding kotlinter configuration that was introduced in version 2.0.0.
Am I missing something or is this duplication necessary?
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (7 by maintainers)
Top Results From Across the Web
FAQ - Ktlint
editorConfig property disabled_rules a rule can be disabled globally. You may also pass a list of disabled rules via the --disabled_rules command line...
Read more >Ktlint ignores .editorconfig - kotlin - Stack Overflow
I wanted to try out Kotlin and ktlint and I was happy to see that it supports tab indentation via the editorconfig file...
Read more >Ktlint: An Anti-Bikeshedding Kotlin Linter with Built-in Formatter
Such behaviour violates .editorconfig specification and leads to ignoring this ... You may also pass a list of disabled rules via the --disabled_rules ......
Read more >ktlint latest version - Awesome Kotlin
Up until ktlint 0.46 the Rule class provided only one life cycle hook. ... this resulted in ignoring all ".editorconfig" files on the...
Read more >jeremymailen / ktlint Download - JitPack
dependencies { implementation 'com.github.jeremymailen:ktlint:0.8.3' } ... Such behaviour violates .editorconfig specification and leads to ignoring this ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Maybe we need an
.editorconfig.editorconfig
so that IntelliJ is formatting our.editorconfig
correctly.Do you still have this line in
.editorconfig
?If not, can you try
gradle clean lintKotlin
and see if it picks up the line length violations then? That’s the only way I could reproduce the bug. Since gradle isn’t aware of the.editorconfig
file as build configuration right now there’s a wrinkle/bug where if you get a successfulgradle lintKotlin
run and then don’t change any source code and only adjust rules in the.editorconfig
file, gradle skips running thelintKotlin
task and thinks it can use the cached result 😕. Sort of a rare situation though.