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

Cannot turn off one rule for one package #742

Closed
VovaStelmashchuk opened this issue May 14, 2020 · 3 comments · Fixed by #752
Closed

Cannot turn off one rule for one package #742

VovaStelmashchuk opened this issue May 14, 2020 · 3 comments · Fixed by #752
Assignees
Labels
Milestone

Comments

@VovaStelmashchuk
Copy link

I want to disable one of my custom rules for one package.

Expected Behavior

Files in package api can ignore rule class-must-be-internal.

Observed Behavior

Linter apply rule class-must-be-internal for all files.

Steps to Reproduce

My .editconfig

[*.{kt, kts}]
disabled_rules = import-ordering, no-wildcard-imports, comment-spacing

[**/api/*.{kt, kts}]
disabled_rules = class-must-be-internal

Your Environment

  • Version of ktlint used:
  • Name and version (or code for custom task) of integration used (Gradle plugin, Maven plugin, command line, custom Gradle task): org.jmailen.gradle:kotlinter-gradle:2.3.2
  • Version of Gradle used (if applicable): 5.6.4
  • Operating System and version: MacOS 10.15.4 (19E287)
  • Link to your project (if it's a public repository):
@shashachu
Copy link
Contributor

@VovaStelmashchuk have you had success overriding any editorConfig properties in the api package (e.g. max_line_length)? I'm trying to figure out if this is a problem with the disabled_rules property or in general we're not merging editorConfig rules properly. My quick local testing suggests that maybe overriding configs for specific paths is broken in general.

@VovaStelmashchuk
Copy link
Author

@shashachu You are right. I cannot disable any rule. May be ktlint has another way to do it.

@shashachu
Copy link
Contributor

@VovaStelmashchuk disabled_rules is working properly for me with [*.{kt,kts}] but not with any other path formats (e.g. **/blah/*.kt). Thanks for the bug report - we'll look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants