I wonder, do you folks use the IntelliJ ktlint <pl...
# ktlint
s
I wonder, do you folks use the IntelliJ ktlint plugin (unofficial)? If yes, how do you handle things like it being on older ktlint versions, while the plugins you use (like kotlinter in my case) use different ktlint versions therefore you start having problems with the two not agreeing with each other? What I’m doing now is just not updating as I guess it’s the only option. If you don’t use it, how do you make your IDE experience not horrible? Without the IDE plugin I really don’t like how I have to either call the gradle task myself to check if anything is off, or the pre-commit check and so on. I much prefer the live experience that the IDE plugin provides. Am I missing some alternative here, or some better approach I should consider adopting instead?
👍 1
p
I am using the plugin as well. Sometimes it is (a bit) annoying when its version is lagging behind a version but I am not really bothered with it. I use the plugin as quick feedback. In my git pre-commit hook as well as during the (maven) compilation phase, I run ktlint in format mode so that it autocorrects as much as possible. Although this is not realtime feedback that the plugin offers, it helps me to detect issues without too much of a hassle. If you’re really annoyed with it, you might consider to contribute a MR for the plugin project to get it updated.
s
Yeah your approach sounds reasonable as well. I'd live with it, but I wouldn't want to introduce my teammates to this friction, so gonna avoid doing it for now. If we do though, combining both sounds reasonable too. Yeah contributing to the plugin sounds like something way above my level of knowledge. I haven't looked into the code but I'd imagine it can't be trivial to jump and fix such stuff.
p
I am not familiar with the code base as well. At least you can try. Most often, the upgrade would be simply bumping the version. But sometimes you have to take care of API changes as well.
n
Yes, the recent breaking API changes have taken a while to ingest into the plugin. Not a lot of time for non-trivial updates to it these days, but I'm making progress as I'm able to
p
Hey Nick, great that you’re making progress, I am a fan of the plugin because of the short feedback loop without having to invoke ktlint manually. I hope you can catch up quickly as the next release (0.48) is around the corner. It again has some API changes but we are nearing a more stable state.
j
Looks like the plugin development/support has stalled, IntelliJ 223.* support PR has been pending for 3 months
p
I don’t think this is the most effective way to ask a maintainer to put more of his valuable time into a repository. It might be better, if you offer your help and ask how you can assist in helping to get this feature merged.
j
Im not asking for anything, commenting here the current state. Will be cloning the plugin later today and making the recommended changes pending merge and incorporating any recent ktlint changes needed and will be submitting a PR
n
By all means! I’m working on 0.47 in parallel, but always encourage folks to help out. I just merged the
223.*
bump and will release it pending some testing
j
@nbadal love what you're doing, let me know if there's any specific support needed and can assist