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

ktlint 0.47.1 displays plenty of warnings about the --disabled_rules argument usage. ktlint_disabled_rules does not get picked up. #1709

Closed
amit-nayar opened this issue Nov 16, 2022 · 2 comments
Milestone

Comments

@amit-nayar
Copy link

Related to #1599

Expected Behavior

When I pass the rules I want to disable in my spotless-ktlint gradle setup using editorConfigOverride, disabled_rules does not produce warnings, or using ktlint_disabled_rules works:

Using disabled_rules

    spotless {
        kotlin {
            target '**/*.kt'
            ktlint(Versions.BuildSystem.KtLint).editorConfigOverride([
                    'disabled_rules' : '<rule_name>',
            ])
        }
    }

Produces warnings.

Using ktlint_disabled_rules

    spotless {
        kotlin {
            target '**/*.kt'
            ktlint(Versions.BuildSystem.KtLint).editorConfigOverride([
                    'ktlint_disabled_rules' : '<rule_name>',
            ])
        }
    }

The map entry is not picked up and the rules are not disabled.

Observed Behavior

When I try to apply disabled_rules to ktlint using spotless, I get many warnings:

Property 'disabled_rules' is deprecated: Rename property 'disabled_rules' to 'ktlint_disabled_rules' in all '.editorconfig' files.
Property 'disabled_rules' is deprecated: Rename property 'disabled_rules' to 'ktlint_disabled_rules' in all '.editorconfig' files.
Property 'disabled_rules' is deprecated: Rename property 'disabled_rules' to 'ktlint_disabled_rules' in all '.editorconfig' files.
Property 'disabled_rules' is deprecated: Rename property 'disabled_rules' to 'ktlint_disabled_rules' in all '.editorconfig' files.
Property 'disabled_rules' is deprecated: Rename property 'disabled_rules' to 'ktlint_disabled_rules' in all '.editorconfig' files.

If I replace with the recommended ktlint_disabled_rules, it does not get picked up and the rules are not disabled.

Steps to Reproduce

Using the spotless plugin in gradle (I am using current latest 6.11.0) the relevant code is under "Expected Behavior" heading.

Your Environment

  • ktlint: 0.47.1
  • spotless: 6.11.0
  • android gradle plugin: 7.1.2
@jjbr
Copy link

jjbr commented Nov 16, 2022

For reference, this seems to be fixed in #1671, so should be available as of the next release.

@amit-nayar
Copy link
Author

Excellent!

@paul-dingemans paul-dingemans closed this as not planned Won't fix, can't repro, duplicate, stale Nov 16, 2022
@paul-dingemans paul-dingemans added this to the 0.48.0 milestone Nov 16, 2022
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