Ktlint: Support for globally disabling a rule

Created on 7 May 2018  路  5Comments  路  Source: pinterest/ktlint

I've seen that this issue of support for globally disabling a rule comes up multiple times. I'd like to propose simple support (not even for a given scope, just across the board) for disabling a comma separated list of rule names in the .editorconfig or some ktlint config file or via command line. This would be an opt-in advanced feature not put any burden on someone who does not want to make any config decisions.

Most helpful comment

@elenigen Detekt is not only available for Gradle. It provides a CLI tool that you can run anywhere.

All 5 comments

As much as I would like to see this feature land in ktlint myself, I think the current option is to look into detekt and https://github.com/arturbosch/detekt/pull/855 specifically, which allows more fine-grained disable/enable of ktlint rules.

Just to let people know, detekt is not an option for maven projects so far, only available on gradle. 馃槥

Although a true statement, there are workarounds...

@elenigen Detekt is not only available for Gradle. It provides a CLI tool that you can run anywhere.

Actually, what I wanted to say is, there's no built-in feature for maven, although there's a workaround.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

filipedelimabrito picture filipedelimabrito  路  3Comments

nokite picture nokite  路  4Comments

tonilopezmr picture tonilopezmr  路  4Comments

DanteAndroid picture DanteAndroid  路  3Comments

volo-droid picture volo-droid  路  4Comments