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

Add spotless for automatic formatting #4766

Merged
merged 2 commits into from
Jun 19, 2024
Merged

Conversation

andreaTP
Copy link
Member

Proposal to use an automatic code formatter.

Notes:

  • the "eclipse" configuration comes straight from here.
  • I'm open to changes to the configuration, just reset to the first commit in this PR, do changes to the config and apply the new style, I'm happy to incorporate the fixes.
  • I attempted to prohibit star imports, but it turned out to be more work and changes than expected, descoped
  • spotless is now formatting also xml, md and more files, I think that changes are good but we can exclude things in case is needed.

@apicurio-bot
Copy link

apicurio-bot bot commented Jun 12, 2024

Thank you for creating a pull request!

Pinging @jsenko, @carlesarnal to respond or triage.

@EricWittmann
Copy link
Member

Note: Waiting on this until after 3.0 Milestone 2 is released.

@andreaTP can you change these two rules:

<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="80"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_resources_in_try" value="80"/>

Set those to 110 instead of 80?

@andreaTP
Copy link
Member Author

@EricWittmann done 👍
I put this on hold until we are ready to merge, as everything will break it.
For our future selves:

  • pick the spotless configuration in pom.xml
  • remove the local formatter configuration in operator/pom.xml
  • pick the ide-config folder

do 1 commit with the setup.
Run:

mvn spotless:appl
mvn spotless:apply -f operator/pom.xml
mvn spotless:apply examples/pom.xml

and you get a "ready to go" PR 🙂

Copy link
Member

@EricWittmann EricWittmann left a comment

Choose a reason for hiding this comment

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

lgtm

@EricWittmann EricWittmann merged commit 973378e into Apicurio:main Jun 19, 2024
19 checks passed
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.

2 participants