Yoann Rodière (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate Search (
https://hibernate.atlassian.net/browse/HSEARCH?atlOrigin=eyJpIjoiYTNmMjcw...
) / Task (
https://hibernate.atlassian.net/browse/HSEARCH-4811?atlOrigin=eyJpIjoiYTN...
) HSEARCH-4811 (
https://hibernate.atlassian.net/browse/HSEARCH-4811?atlOrigin=eyJpIjoiYTN...
) Automated code formatting (
https://hibernate.atlassian.net/browse/HSEARCH-4811?atlOrigin=eyJpIjoiYTN...
)
Issue Type: Task Assignee: Unassigned Components: build Created: 02/Mar/2023 23:51 PM Fix
Versions: 6.2-backlog Priority: Major Reporter: Yoann Rodière (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
In Quarkus for example, the build is set up to:
* check formatting and imports very strictly on compilation
* auto-format code and auto-sort imports on request (on process-sources )
This has benefits (very consistent style) and drawbacks (annoying build failures just
because of formatting), but since we already enforce a (rather loose) style, I thing we
could benefit from the same approach.
Introducing tooling wouldn’t be a problem, we just have to copy what’s been done on
Quarkus, replacing the Quarkus style with our own.
We will have to adapt the contribution guide as well.
The real problem will be dealing with Git history, since I expect a big commit that will
reformat almost every file in the code base. Maybe we should introduce a file listing all
commits to ignore in git-blame, as explained here (
https://moxio.com/blog/ignoring-bulk-change-commits-with-git-blame/#git-2...
). It would require setup on each clone ( git config ), but some setup is already required
to use the proper style in Intellij, so it’s no big deal. Plus, it seems compatible with
the git blame feature inside Intellij IDEA (
https://youtrack.jetbrains.com/issue/IDEA-221278 ).
NOTE: We’d better do this in a version of Hibernate Search that will not require much
backports, because the “big formatting commit” will make backporting rather annoying (many
conflicts).
(
https://hibernate.atlassian.net/browse/HSEARCH-4811#add-comment?atlOrigin...
) Add Comment (
https://hibernate.atlassian.net/browse/HSEARCH-4811#add-comment?atlOrigin...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100217- sha1:65be9f2 )