3 ms·
You wrote this entire comment but ktlint can generate a .editorconfig (and in fact used to generate a IntelliJ specific config file) which is a universal way of
by BoorishBears 4y ago
You wrote this entire comment but ktlint can generate a .editorconfig (and in fact used to generate a IntelliJ specific config file) which is a universal way of solving this exact problem.
Pretty sure the FB equivalent also has a matching .editorconfig
Also you could just setup a prepush hook so they run before your CI does which afaik both give you examples of.
- gavinray 4y agoI use pre-commit/pre-push hooks to apply formatters like Spotless/ktfmt etc, it's too much work to try to fight Intellij's formatting. There's a ktfmt IntelliJ plugin that does work most of the time IME, if you're willing to give it a shot.
- BoorishBears 4y agoMy auto-generated config has been pretty solid The only time the pre-push hook fails is if a line is too long and there's no "canonical" way to fix it (so it'll create a method chain for example, but it won't do string concatenation since there's N ways to break a string across lines)