JLLeitschuh / ktlint-gradle

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

Disable filename rule does not work #268

Closed grashwin closed 5 years ago

grashwin commented 5 years ago

I added the .editorconfig but still not able to disable the filename rule. disabled_rules = filename

Turned on the debug and could see the settings are being applied [DEBUG] Discovered .editorconfig (/some/path) {charset=utf-8, disabled_rules=filename, end_of_line=lf, indent_size=4, indent_style=space, insert_final_newline=true, trim_trailing_whitespace=true}

Still getting file name errors when i run ./gradlew ktlintFormat [ERROR] class TestEnum should be declared in a file named TestEnum.kt (cannot be auto-corrected)

Tapchicoma commented 5 years ago

You have space between assignment, it should look following:

disabled_rules=filename

Related to pinterest/ktlint/issues/555

grashwin commented 5 years ago

You have space between assignment, it should look following:

disabled_rules=filename

Related to pinterest/ktlint/issues/555

Thanks for the reply. I tried that but does not work. The debug log shows that it is without space [DEBUG] Discovered .editorconfig (/some/path) {charset=utf-8, disabled_rules=filename, end_of_line=lf, indent_size=4, indent_style=space, insert_final_newline=true, trim_trailing_whitespace=true}

Tapchicoma commented 5 years ago

Just to be sure, have you set ktlint version in plugin configuration to 0.34.2?

ktlint {
  version.set("0.34.2")
}

Latest release of plugin, by default, uses 0.33.0.

grashwin commented 5 years ago

That worked. Sorry for the delay response.

grashwin commented 5 years ago

Make sure to use latest ktlint version