close
Skip to content

Upgrade diktat to 1.2.0#1246

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

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

Conversation

@nulls

@nulls nulls commented Jun 24, 2022

Copy link
Copy Markdown
Contributor

Bump default diktat version to latest 1.1.0 -> 1.2.0

It closes saveourtool/diktat#1399

@nulls

nulls commented Jun 24, 2022

Copy link
Copy Markdown
Contributor Author

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

orchestr7 commented Jun 24, 2022

Copy link
Copy Markdown
Contributor

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

@nedtwigg nedtwigg left a comment

Copy link
Copy Markdown
Member

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

nulls commented Jun 28, 2022

Copy link
Copy Markdown
Contributor Author

@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