Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade ktlint -> 0.42.0 #215

Closed
wants to merge 3 commits into from
Closed

Conversation

Mahoney
Copy link
Contributor

@Mahoney Mahoney commented Jul 31, 2021

Fixes a nasty performance bug: pinterest/ktlint#1135

Fixes a nasty performance bug: pinterest/ktlint#1135
@Mahoney
Copy link
Contributor Author

Mahoney commented Jul 31, 2021

Wow. Didn't expect that to break the world!

@Mahoney
Copy link
Contributor Author

Mahoney commented Jul 31, 2021

Ugh... ktlint has bumped the kotlin version to 1.5.20. So can't upgrade without gradle upgrading their embedded kotlin version.

gradle depending on a specific version of kotlin, and being so slow to update, is a grade a pain.

Mind you, ktlint going up a major version of kotlin in a release that fixes a major performance regression is also less than kind.

ktlint 0.42.0 depends on 1.5.10. Gradle embeds kotlin 1.4, which prevents plugins depending on 1.5.x.

By fixing the kotlin version to 1.4.x the build passes - looks like ktlint doesn't use any 1.5 exclusive features?
@Mahoney
Copy link
Contributor Author

Mahoney commented Jul 31, 2021

Build passes if I fix the kotlin version.

@Mahoney
Copy link
Contributor Author

Mahoney commented Jul 31, 2021

Nope, doesn't then work as a plugin. Fail.

@Mahoney Mahoney closed this Jul 31, 2021
@jeremymailen
Copy link
Owner

Hi @Mahoney thanks for the assist. I've been tracking the progress of 0.42.0 and will upgrade soon. Right now it looks like it's got some indent regressions, so I'm waiting in anticipation of a 0.42.1 soon which might address them.

Unless something new has gone sideways with gradle (such as it did before 6.8) it should be possible to take the 1.5.x kotlin upgrade even if have to declare the newest version of kotlinter will require kotlin 1.5.x. This happens periodically because of the dependency on the internal kotlin compiler.

BTW, I do not believe pinterest/ktlint#1135 effects kotlinter. We integrate directly with the ktlint-core portion of the library and do not use the file globbing code in the cli component where the performance issue was. Are you seeing performance problems in kotlinter?

@Mahoney
Copy link
Contributor Author

Mahoney commented Aug 1, 2021

OK, not scientific but having installed the pre push commit hook I had had a couple of times when it felt very slow, saw the performance regression on ktlint and assumed that was it.

It might be that gradle keeps having to spin up a new daemon because of a memory leak somewhere in my build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants