question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

disabled-rules for ktlint in .editorconfig is ignored

See original GitHub issue

Since 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:closed
  • Created 4 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

5reactions
mindhaqcommented, Sep 26, 2019

Maybe we need an .editorconfig.editorconfig so that IntelliJ is formatting our .editorconfig correctly.

3reactions
jeremymailencommented, Aug 8, 2019

Do you still have this line in .editorconfig?

disabled_rules              = max-line-length,import-ordering

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 successful gradle lintKotlin run and then don’t change any source code and only adjust rules in the .editorconfig file, gradle skips running the lintKotlin task and thinks it can use the cached result 😕. Sort of a rare situation though.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found