Replies: 1 comment
-
|
I still don't know how to answer this question programmatically; for now the default version is apparently specified here: If you're following along from home, then this is what's left to do: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
ktlint has just been inflicted onto me, and I'm trying to integrate it into my workflow.
I've been using jj as a layer on top of git to make it easier to manage patch series. It lets me take a PR with 10 commits, edit the 3rd, and have the changes automatically ripple through the remaining 6 commits, without needing to enter a special git rebase flow.
Of course, any rebase operation could turn code that ktlint was happy with into code that ktlint is unhappy with. jj doesn't support commit hooks (long story), but it does accommodate for code reformatters — so long as they read source code from stdin, and write formatted source code to stdout, preferrably without throwing hands (ktlint being unable to wrap long lines around on its own is very disappointing).
Now, ktlint-cli supports this mode of operation — but ktlint-gradle seems like it doesn't. No big deal: I just need to get a copy of
ktlint-clithat agrees with the version ofktlint-gradlethe team has adopted (in my specific case, 13.1.0).According to this discussion, this line of code is not authoritative and the version of ktlint being used is... another one. It can be specified in the gradle file, but it hasn't been, and our team just had to deal with the major pain that is a commit that performs a whole-codebase rewrite.
What I do know is that ktlint-cli 1.7.1 and ktlint-gradle 13.1.0 produce significantly different diffs on top of a topic branch, so I must be running the wrong version of ktlint-cli. So: which version of ktlint-cli do I need? How can I find out? The :buildEnvironment task doesn't seem to bring enlightenment:
So... how can I find out which version of ktlint-cli I need to match the version of ktlint-gradle my team has adopted? Is there a command I can run to find out?
Beta Was this translation helpful? Give feedback.
All reactions