JLLeitschuh / ktlint-gradle

A ktlint gradle plugin
MIT License
1.47k stars 160 forks source link

Support `--disabled-rules` CLI option in `ktlintFormat` and `ktlintCheck` #707

Closed Taewan-P closed 1 year ago

Taewan-P commented 1 year ago

Thinking of supporting the CLI option for disabling rules? As disabling rules in .editorconfig is deprecated in KtLint version 0.48 and are removed in 0.49, the only way to disable the rules globally without .editorconfig is using the --disabled-rules option via KtLint CLI.

ref) #267

wakingrufus commented 1 year ago

Yes I am working on a solution for this for ktlint 0.48+. I hope to have it finished by the end of next week

Taewan-P commented 1 year ago

Great! Thank you for the support 😃

Taewan-P commented 1 year ago

@wakingrufus Using version 1.0.0, I see the following error:

Found invalid '.editorconfig' property value: Property 'max_line_length' expects an integer. The parsed 'disabled' is not an integer.

I added

version.set("1.0.0")
additionalEditorconfig.set(
    mapOf(
        "max_line_length" to "disabled"
    )
)

in my build.gradle file. Is this not the way to use the --disabled-rules option?