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 diktat to 1.2.0 #1246

Merged
merged 10 commits into from Jun 30, 2022
Merged

Upgrade diktat to 1.2.0 #1246

merged 10 commits into from Jun 30, 2022

Conversation

nulls
Copy link
Contributor

@nulls nulls commented Jun 24, 2022

Bump default diktat version to latest 1.1.0 -> 1.2.0

It closes saveourtool/diktat#1399

@nulls
Copy link
Contributor Author

nulls commented Jun 24, 2022

Hi,

We (diktat) released the new version 1.2.0. It has breaking changes and requires changes in spotless.
This PR with supporting these changes.

@akuleshov7
Copy link
Contributor

akuleshov7 commented Jun 24, 2022

Probably there can be some problems with backward compatibility.
Is there any chance to raise an error for older versions of diktat? @nedtwigg

Copy link
Member

@nedtwigg nedtwigg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the code now requires 1.2.0 or greater, that's fine, but:

  • it needs to be marked in the changelogs
  • DiktatStep.create needs to parse the version number, and proactively throw an error if less than 1.2.0 (BadSemver should make this pretty easy.)

@nedtwigg
Copy link
Member

(Also you need to run gradlew spotlessApply)

@nulls
Copy link
Contributor Author

nulls commented Jun 28, 2022

@nedtwigg, new version of diktat requires ktlint:0.46.1.
If spotless run with ktlint < 0.46.1 and diktat > 1.2.0, what's version of ktlint will be on classpath?

As I can see, there is com.diffplug.spotless.FeatureClassLoader which is used to load jars for FormatterStep. Does it mean that dependencies for formatters are isolated?

@nedtwigg nedtwigg enabled auto-merge June 29, 2022 23:13
@nedtwigg
Copy link
Member

Correct, Spotless classloaders are isolated. BTW, this PR bumps diktat to 1.2.1, which seems to not exist. I'm going to downgrade this to 1.2.0

https://search.maven.org/artifact/org.cqfn.diktat/diktat-rules

@nedtwigg nedtwigg merged commit d951b89 into diffplug:main Jun 30, 2022
@nulls nulls deleted the feature/diktat_1.2.0 branch June 30, 2022 09:01
@nedtwigg
Copy link
Member

Released in plugin-gradle 6.8.0 and plugin-maven 2.23.0.

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.

1.2.0 Regression: java.lang.ClassNotFoundException: com.pinterest.ktlint.core.KtLint$Params
3 participants