Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable filename rule does not work #268

Closed
grashwin opened this issue Aug 14, 2019 · 5 comments
Closed

Disable filename rule does not work #268

grashwin opened this issue Aug 14, 2019 · 5 comments
Labels

Comments

@grashwin
Copy link

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
Copy link
Collaborator

You have space between assignment, it should look following:

disabled_rules=filename

Related to pinterest/ktlint/issues/555

@grashwin
Copy link
Author

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
Copy link
Collaborator

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
Copy link
Author

grashwin commented Sep 4, 2019

That worked. Sorry for the delay response.

@grashwin
Copy link
Author

grashwin commented Sep 4, 2019

Make sure to use latest ktlint version

@grashwin grashwin closed this as completed Sep 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants