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

Spotless plugin #107

Merged
merged 16 commits into from
Dec 13, 2019
Merged

Spotless plugin #107

merged 16 commits into from
Dec 13, 2019

Conversation

dansanduleac
Copy link
Contributor

Before this PR

Logic for how to format a project with PJF is coupled between palantir-java-format and gradle-baseline.
This makes it hard for users to apply the formatter gradle plugin directly, because it needs the wiring from com.palantir.baseline-format to actually set up all the formatting tasks.

After this PR

==COMMIT_MSG==
Move spotless configuration logic into a new plugin com.palantir.java-format-spotless. The main com.palantir.java-format plugin now applies both the spotless and idea plugins too.
==COMMIT_MSG==

Possible downsides?

@changelog-app
Copy link

changelog-app bot commented Dec 11, 2019

Generate changelog in changelog/@unreleased

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

A new plugin com.palantir.java-format-spotless configures gradle-spotless (if applied) to format java files using palantir-java-format.
The main com.palantir.java-format plugin now applies both the spotless and idea plugins too.

Check the box to generate changelog(s)

  • Generate changelog entry

@policy-bot policy-bot bot requested review from iamdanfox and CRogers December 11, 2019 19:10
@dansanduleac
Copy link
Contributor Author

It's sad that gradle-palantir-java-format now has to depend on the spotless plugin (not compileOnly), but this seems to be the only straightforward way to configure that plugin.

@dansanduleac
Copy link
Contributor Author

Update: was able to make it work with compileOnly - it's trickier to set this up when testing, but when using the plugin, since all the dependencies are resolved together, this will just work.

@bulldozer-bot bulldozer-bot bot merged commit 75c25c1 into develop Dec 13, 2019
@bulldozer-bot bulldozer-bot bot deleted the ds/spotless-plugin branch December 13, 2019 14:08
@svc-autorelease
Copy link
Collaborator

Released 0.3.9

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

Successfully merging this pull request may close these issues.

3 participants