Skip to content

Upgrade diktat to 1.2.0#1246

Merged
nedtwigg merged 10 commits intodiffplug:mainfrom
nulls:feature/diktat_1.2.0
Jun 30, 2022
Merged

Upgrade diktat to 1.2.0#1246
nedtwigg merged 10 commits intodiffplug:mainfrom
nulls:feature/diktat_1.2.0

Conversation

@nulls
Copy link
Copy Markdown
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
Copy Markdown
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.

@orchestr7
Copy link
Copy Markdown
Contributor

orchestr7 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
Copy Markdown
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
Copy Markdown
Member

(Also you need to run gradlew spotlessApply)

@nulls nulls force-pushed the feature/diktat_1.2.0 branch from c0b44c8 to f6de4bb Compare June 28, 2022 16:34
@nulls
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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