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

[Question] The .editorconfig disable role is configurated and still used #324

Closed
Numichi opened this issue Apr 23, 2023 · 5 comments
Closed

Comments

@Numichi
Copy link

Numichi commented Apr 23, 2023

Why not disable the filename Ktlint role from the standard role set?

build.gradle.kts

plugins {
    id("org.jmailen.kotlinter") version "3.14.0"
}

.editorconfig

[*]
indent_size = 4
indent_style = space
trim_trailing_whitespace = false
insert_final_newline = true
max_line_length = 180

[*.{kt,kts}]
ktlint_standard = enabled
ktlint_experimental = enabled
ktlint_standard_filename = disabled

And filename role will be run, and I get: Lint error > [filename] File name mapping.kt' should conform PascalCase.

I tried to configure it from https://pinterest.github.io/ktlint/rules/configuration-ktlint/#disabled-rules

@Jolanrensen
Copy link

Same here, other rules like ktlint_standard_curly-spacing = disabled also still seem to be applied

@jeremymailen
Copy link
Owner

jeremymailen commented Apr 26, 2023

I have to disable the filename rule in one of my own projects, so I believe it should work.

Try restarting your Gradle daemon and running it again. I've still gotten bug reports that sometimes it's caching an old editorconfig content.

If that doesn't fix it, please provide repro steps with the location of your .editorconfig file and module directory structure. The kotlinter-gradle plugin is trying to be very hands off with editorconfig at this point (only marking the lint tasks as dirty when editorconfig is changing). We mostly leave it up to the ktlint engine to pick up and process this file.

@Jolanrensen
Copy link

Indeed after switching branches, cleaning, reimporting the gradle project etc. the disable rule seems to work. However, it's still strange the rules don't get applied immediately.

@jeremymailen
Copy link
Owner

Yeah, it seems to be a bug. The editorconfig file is supposed to be one of the build inputs such that the lint tasks re-run when it is changed. For some reason that seems to not be happening sometimes.

I'm going to close this issue for the moment since the title might be misleading and make sure to open a bug around editorconfig staleness.

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

No branches or pull requests

3 participants