-
Notifications
You must be signed in to change notification settings - Fork 506
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Use cli param value as a source of globally disabled rules #533
Comments
An |
The Google Kotlin style guide (which encompasses all Kotlin code written at Google, not just Android code) also has this rule and they are ktlint consumers. It's currently a copy of the Google Android Kotlin style guide with some tweaks (such as 2 spaces instead of 4, praise be). I hope one day to invert that dependency and have a publicly-published Google Kotlin style guide with the Google Android Kotlin style guide being only tweaks to it (4 space instead of 2, booooooooo). |
Call the potatoes If not, the first proposal seems to be pretty simple to implement which would be satisfactory as well. |
After a bit of thinking - I think we need to proceed with the first proposal: just adding a cli param to do the same as #503 does. I'll describe the thought process: since the notion of default changes with the ruleset proposal, the current consumers will need to switch to the behaviour they got used to. I imagine you need to maintain your current audience happy, only new consumers are not happy with this no-wildcards enabled. Hence, the strict one becomes default, and the other ruleset just weakens rules. However, for this it would be more flexible to provide the above-mentioned cli param. |
Makes sense. Moving rules into I'll put up a PR for adding |
Fixes pinterest#533 Note: command line flag will override `.editorconfig`
Thank you for a quick turnaround @shashachu 🎉 |
Fixes #533 Note: command line flag will override `.editorconfig`
I'll wait a couple days to make sure there aren't any other issues we need to patch for 0.34.0 then put up a new release. |
Fixes pinterest#533 Note: command line flag will override `.editorconfig`
@idntfy I just released 0.34.1 with the new flag. |
Fixes pinterest/ktlint#533 Note: command line flag will override `.editorconfig`
Context
Add support for disabled_rules property in .editorconfig for globally disabling rules #503 - adds support for globally disabled rules through editorconfig
Wildcard imports #48 - summarising, is a very long discussion about abusing the authority by enabling no-wildcard-import by default in the tool we all love.
This issue is an attempt to find a pragmatic consensus.
Although it would seem that #503 could resolve the situation around #48 but it still hurts the wide adoption of the tool.
On a scale it's really hard to adopt now when it's enabled. We have both big number of projects and even more bigger number of developers. Committing .editorconfig to all the projects or asking everyone to call --apply-to-idea-project are just no way to go, because it cannot be centralized thus hardly manageable.
The Proposal 1 (UPD: this was chosen to implement now)
Introduce a cli param value of which would be used as a source to the functionality already introduced in #503 - so basically it's nothing new.
In this form it can be configured widely even across many projects, e.g. if parent-pom or some common maven/gradle plugin is used, without committing .editorconfig to all the projects and without asking an every single developer to change default idea settings by calling --apply-to-idea-project.
The Proposal 2 (UPD: #548 was created to discuss further)
Create several sets of code styles:
Make it switchable through cli param. Thus all the parties - android developers and the rest - would use what they need.
Bottomline: while 2 could be too extreme, 1 is just a simple addition to the functionality that already exists.
The text was updated successfully, but these errors were encountered: