-
Notifications
You must be signed in to change notification settings - Fork 506
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
Unable to disable "filename" rule #237
Comments
Confirmed and thank you for the ticket. I'll have a fix ready within 24h. |
0.24.0 released 🎈. |
Confirmed. Thanks, @shyiko! |
Are there any other options? Since I have in each class there is an annotation that should be at the top, but if I write below it but above the package name, the command doesn't work. |
@mnewlive You can add [*.{kt,kts}]
disabled_rules=filename |
using this method I can disable the rule for all classes, |
@mnewlive just to confirm - you want to disable this rule for a specific folder? |
for a specific class/classes |
then you could modify [src/main/kotlin/**/*Interface.kt]
disabled-rules=filename For more info how to use |
I tried to write smth like this:
But also get error for my class:
|
I have a couple of files on which I'd like to temporarily disable the recently-added
filename
rule. An example of such a rule violation in my project follows:However, I can't seem to get ktlint to honor my
ktlint-disable
directive for this rule. Since ktlint reports the violation at row 1, column 1, I tried placing both of the following directives on the first line of the file in question:and
Unfortunately, neither had any effect with respect to the
filename
rule, and the violation was still reported. Am I missing something obvious about how to disable this rule?I'm wondering if, because
FilenameRule
applies to the root node of the AST, it's simply running before any suppression directives are encountered in the remainder of the AST? In which case, is there some other syntax one can use to disable such a "root" rule?The text was updated successfully, but these errors were encountered: