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

Allow disabled_rules in editorconfig section #672

Closed
dan-f opened this issue Dec 18, 2019 · 4 comments
Closed

Allow disabled_rules in editorconfig section #672

dan-f opened this issue Dec 18, 2019 · 4 comments

Comments

@dan-f
Copy link

dan-f commented Dec 18, 2019

I've got a kotlin project in which it's common practice to create files which hold multiple classes. In each of these cases we name the file with a common suffix.

A simple example of this, using the suffix "Things" would be something like:

// FooThings.kt

data class Foo(...)

data class Bar(...)

The problem is that we trip the filename rule when there's only one such class in one of these files.

Based on this comment - #237 (comment) - I was hopeful I could add an .editorconfig rule like so to disable the filename error:

[**/*Things.kt]
disabled_rules = filename

However, this doesn't work.

@Tapchicoma
Copy link
Collaborator

What ktlint version are you using?

Could try to modify your .editorconfig to:

[**/FooThings.kt]
disabled_rules = filename

or if it will still fail to:

[*.{kt,kts}]
disabled_rules = filename

and report back if this will work.

@dan-f
Copy link
Author

dan-f commented Dec 19, 2019

Version 0.36.0. Your suggestion "worked" in the sense that it disabled the filename rule for every kotlin file. However, the feature I'm looking for is the ability to disable the filename rule for kotlin files that end with a specific suffix (other than simply .kt).

To be clear the following also does not disable the filename rule for full/path/to/FooThings.kt:

[full/path/to/FooThings.kt]
disabled_rules = filename

@Tapchicoma
Copy link
Collaborator

Interesting, probably there is a bug in .editorconfig globs parsing. I need to check it.

@Tapchicoma Tapchicoma added the bug label Dec 19, 2019
@romtsn
Copy link
Collaborator

romtsn commented May 28, 2020

Closing in favour of #742, please track it there.

@romtsn romtsn closed this as completed May 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants