Skip to content

Bump ktfmt to 0.21 and add support to Google and Kotlinlang formats#812

Merged
nedtwigg merged 1 commit intodiffplug:mainfrom
JavierSegoviaCordoba:ktfmt-multiple-style
Mar 5, 2021
Merged

Bump ktfmt to 0.21 and add support to Google and Kotlinlang formats#812
nedtwigg merged 1 commit intodiffplug:mainfrom
JavierSegoviaCordoba:ktfmt-multiple-style

Conversation

@JavierSegoviaCordoba
Copy link
Copy Markdown
Contributor

@JavierSegoviaCordoba JavierSegoviaCordoba commented Mar 5, 2021

Manually tested, @cgrushko can you take a look at this PR?

Should getCustomFormattingOptions have a better way to manage ktfmt versioning availability? I was thinking about adding to the Style enum a since property to throw errors.

EDIT:

I added the since property so spotless will throw an exception if the user tries to use a ktfmt version that doesn't have a specific format.

@nedtwigg nedtwigg mentioned this pull request Mar 5, 2021
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.

  • add link to this PR in plugin-gradle/CHANGES.md, and put it under ### Added
  • copy this entry also to plugin-maven/CHANGES.md and CHANGES.md

I noted an optional refactor below. Nice to have but not necessary for a merge-and-release.

@JavierSegoviaCordoba
Copy link
Copy Markdown
Contributor Author

@nedtwigg has spotless a way to compare two versions so I can delete the Version class I added?

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.

The version check is nice, but needs to be thread-safe.

Comment thread lib/src/main/java/com/diffplug/spotless/kotlin/KtfmtStep.java Outdated
Comment thread lib/src/main/java/com/diffplug/spotless/kotlin/Version.java Outdated
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.

Still missing an entry in the root CHANGES.md. Once that gets done I think this is ready to merge and release.

@nedtwigg nedtwigg merged commit 72aa24a into diffplug:main Mar 5, 2021
@nedtwigg
Copy link
Copy Markdown
Member

nedtwigg commented Mar 5, 2021

Released in plugin-gradle 5.11.0 and plugin-maven 2.9.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.

2 participants