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

Enable external rules #1747

Closed
paul-dingemans opened this issue Dec 26, 2022 · 0 comments · Fixed by #1753
Closed

Enable external rules #1747

paul-dingemans opened this issue Dec 26, 2022 · 0 comments · Fixed by #1753
Milestone

Comments

@paul-dingemans
Copy link
Collaborator

paul-dingemans commented Dec 26, 2022

Since Ktlint 0.48.0 a non-standard ruleset has to be enabled explicitly in order to run the rules. This also applies to a custom rule set and to rules provided via an API consumer.

Ktlint CLI
As the custom rule set will only be run when option -R /path/to/custom/rule-set.jar is passed to the Ktlint CLI it is convenient when the rule set does not need to enabled explicitly in the .editorconfig. Like is done with parameter --experimental a custom rule which is specified via -R /path/to/custom/rule-set.jar should be enabled automatically. Using the .editorconfig the user can still disable the entire rule set or specific rules.

API Consumer
Rules provided via the API Consumer should be allowed automatically. It is the responsibilitity of the API consumer to provided rules which may be run. Using the .editorconfig the user can still disable the entire rule set or specific rules.

@paul-dingemans paul-dingemans added this to the 0.48.1 milestone Dec 26, 2022
@paul-dingemans paul-dingemans changed the title Enable custom ruleset when specified in Ktlint CLI Enable external rules Dec 27, 2022
paul-dingemans added a commit to paul-dingemans/ktlint that referenced this issue Dec 29, 2022
…ault. There is no benefit in forcing the Ktlint CLI and API Consumers to enable the rule sets for their rules explicitly as the developer already consented to using their rules by either specifying a custom rule set JAR via the CLI or by using the API Consumer. However, the benefit of being able to disable a rule set still remains.

Closes pinterest#1747
paul-dingemans added a commit that referenced this issue Dec 31, 2022
* Enable non-experimental rule sets (including custom rule sets) by default. There is no benefit in forcing the Ktlint CLI and API Consumers to enable the rule sets for their rules explicitly as the developer already consented to using their rules by either specifying a custom rule set JAR via the CLI or by using the API Consumer. However, the benefit of being able to disable a rule set still remains.

Closes #1747
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

Successfully merging a pull request may close this issue.

1 participant