Join GitHub today
Poll: Should we support 2 spaces indentation? #43
While official stance of JetBrains (citation needed) is 4 it's seems like we're alienating considerable chunk of the community (Square, Trello, etc.) by not allowing indentation with 2 spaces.
So the question is: should we allow 2 spaces for indentation or adhere to the official recommendation?
I could but that would be against the "no configuration" policy and we would be back in checkstyle territory. If there is a config file then why not to allow user to configure every aspect of ktlint? I mean, it requires minuscule amount of code and little effort, so why not?
The thing is, I want to keep ktlint simple for the user, keep it a "drop in" solution. You just add it and forget it (you can turn auto-correction (-F flag) on by default (as part of mvn verify / gradle check; or bind it to a commit hook) so that ktlint would do its job without bothering you too much).
Now, if there is a huge demand for 2 space indentation (and it seems like this is the case) - one way to tackle the problem is to have 2 ktlint artifacts (which have exactly the same set of rules with 1 distinction - indentation rule):
added a commit
May 28, 2017
referenced this issue
May 28, 2017
P.S. Recommendation is still to use 4 spaces for indentation. Official position has not changed