Skip to content

Add formatter plugins and automatic format execution profile#41

Merged
xstefank merged 3 commits intojbosstm:mainfrom
xstefank:formatter
May 21, 2025
Merged

Add formatter plugins and automatic format execution profile#41
xstefank merged 3 commits intojbosstm:mainfrom
xstefank:formatter

Conversation

@xstefank
Copy link
Collaborator

@xstefank xstefank commented May 13, 2025

This is using the formatting settings from Quarkus 3.22.2. But we can opt for something custom if there is a need.

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@mmusgrov
Copy link
Member

This is using the formatting settings from Quarkus 3.22.2. But we can opt for something custom if there is a need.

I only skimmed the diffs but they look good, thanks for raising it. I'll leave it to Marco to provide the actual review.

<configuration>
<!-- store outside of target to speed up formatting when mvn clean is used -->
<cachedir>.cache/formatter-maven-plugin-${version.formatter.plugin}</cachedir>
<configFile>eclipse-format.xml</configFile>
Copy link
Member

Choose a reason for hiding this comment

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

I might be "wrong" about where I am going with this - but I noticed this part and wonder if we know that the eclipse format (or maybe rather than a style, it means formating for Eclipse IDE?) is compatible with https://github.com/jbosstm/narayana-checkstyle-config/blob/main/src/main/resources/narayana-checkstyle/checkstyle.xml. Hopefully it is, but we should anyway add an update to the https://github.com/jbosstm/lra/blob/main/CONTRIBUTING.md to describe this formatting requirement too (assuming it is a new one). Like Mike though, I defer to @marcosgopen for the review (but would mention I could imagine sharing this proposed addition to the developer "requirements" on Zulip (for feedback) and merging say a week or so later if there are no blockers raised in the wider community after the chance for feedback but again, I defer to Marco for deciding this.

@marcosgopen
Copy link
Member

Thanks @xstefank for raising this, I created a zulip topic to talk about this: https://narayana.zulipchat.com/#narrow/channel/323715-developers/topic/Introducing.20a.20new.20formatter.20in.20Narayana.20LRA/with/518074468
Let's wait for a week or so for feedback as Tom suggested.

<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-ide-config</artifactId>
Copy link
Member

Choose a reason for hiding this comment

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

Overall the formatting changes look good, thanks @xstefank
I had a look at the rules (https://github.com/quarkusio/quarkus/blob/main/independent-projects/ide-config/src/main/resources/eclipse-format.xml) and I think they look good.
However I don't actually like to be dependent on a quarkus indipendent-project and I would slightly prefer having our formatting rules in our jbosstm project https://github.com/jbosstm/narayana-checkstyle-config/tree/main. That would mean to open a PR there and make a 'narayana-checkstyle-config' release to be able to customize it. Said that I don't think we need to customize those rules at the moment so we can use the quarkus dependency for the moment. WDYT @tomjenkinson , @jmfinelli and @mmusgrov ?

Copy link
Member

Choose a reason for hiding this comment

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

That is a great idea, yeah. In my opinion we can decouple it later and not need Martin to change that part now. I do think that we should have the CONTRIBUTING.md reference the expectation (citing a reference to the quarkus one) with this pull request (and we change that later too) so it goes in as close to atomic change as possible but if needed the CONTRIBUTING.md change could be added as a separate commit but we should be ready to go with that.

Copy link
Member

Choose a reason for hiding this comment

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

+1

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@xstefank xstefank force-pushed the formatter branch 2 times, most recently from 22993d3 to 0954c47 Compare May 14, 2025 16:07
@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

CONTRIBUTING.md Outdated
1. Perform a Code Review with the project maintainers on the pull request.

Remember to also run the full build (`./mvnw clean package -DskipTests`) before
you open the pull request to format your changes.
Copy link
Member

@tomjenkinson tomjenkinson May 14, 2025

Choose a reason for hiding this comment

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

Thank you for pushing this commit in (and the change to the GitHub action - that's very helpful too, thank you). Personally I would prefer the wording to fit more into the list above (in particular I would mention that the way it is parseable at this time doesn't technically direct the contributor to include the formatted code within their pull request and committing takes place in step 2) but in my opinion, updating the CONTRIBUTING.md so as to be able to identify to a contributor that code formatting is a part of the process is the critical thing to introduce with this pull request and that has been done. @marcosgopen is should still provide the review, but I would share that it works for me.

Thank you, Martin!

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@@ -0,0 +1,22 @@
name: LRA-CORE
Copy link
Member

Choose a reason for hiding this comment

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

+1 to have this github action, could you call it 'LRA-FORMATTING' or something like that please? @xstefank

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

Copy link
Member

@marcosgopen marcosgopen left a comment

Choose a reason for hiding this comment

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

Thanks @xstefank for your PR!

@tomjenkinson
Copy link
Member

Thank you @xstefank too - and Marco for the review

@marcosgopen maybe we put a Hold label on this during the community feedback period described in #41 (comment) so it's more obvious we (committers) shouldn't merge it for now? What do you think?

@marcosgopen
Copy link
Member

Good point Tom, let's wait for a few days more for community's feedback, I put the on hold label in the meanwhile.

@marcosgopen marcosgopen removed the Hold label May 21, 2025
@xstefank xstefank merged commit 3a82d01 into jbosstm:main May 21, 2025
4 checks passed
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.

5 participants