Ktlint: Required simple configuration file (like in checkstyle)

Created on 20 Jun 2018  路  2Comments  路  Source: pinterest/ktlint

Ktlint is really weird.

You force others to use your pre-compiled rules and give no option to easy disable those rules.

I do not want to add additional comments in my code to disable some checks, it is stupid.

Using IDE's configuration files it horrible idea, because cool programmers do not store any IDE configuration files in project repository.

I just want to disable some of your checks globally in gradle or just use some configuration file where I can disable them (and just provide path to this file from gradle)

How can you even came to the idea, that creating my own Jar with additional rules it the good way to configure ktlint? The only way to make it "more comfortable" is to force this jar to be OSGI compatible.

Most helpful comment

sorry

All 2 comments

sorry

You force others to use your pre-compiled rules and give no option to easy disable those rules.

No one is forcing anyone :) https://github.com/shyiko/ktlint/issues/190#issuecomment-383021426

I do not want to add additional comments in my code to disable some checks, it is stupid.

From https://github.com/shyiko/ktlint#how-do-i-suppress-an-error:
This is meant primarily as an escape latch for the rare cases when ktlint is not able to produce the correct result (please report any such instances using GitHub Issues).

Using IDE's configuration files it horrible idea, because cool programmers do not store any IDE configuration files in project repository.

Don't like --apply-to-idea-project? Use global variant - --apply-to-idea. Not good enough either? Create a dedicated IntelliJ plugin and I'll gladly add a link to the README.

I just want to disable some of your checks globally in gradle or just use some configuration file where I can disable them (and just provide path to this file from gradle)

https://standardjs.com/index.html#i-disagree-with-rule-x-can-you-change-it

How can you even came to the idea, that creating my own Jar with additional rules it the good way to configure ktlint? The only way to make it "more comfortable" is to force this jar to be OSGI compatible.

Additional rules are not meant to be used to "configure ktlint" (nor can they be used for that purpose). They are strictly for extending (not overriding) existing rulset.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Tapchicoma picture Tapchicoma  路  3Comments

tonilopezmr picture tonilopezmr  路  4Comments

chao2zhang picture chao2zhang  路  4Comments

ZakTaccardi picture ZakTaccardi  路  4Comments

plastiv picture plastiv  路  4Comments