-
Notifications
You must be signed in to change notification settings - Fork 77
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
Formatting rules #731
Formatting rules #731
Conversation
d098024
to
3be523d
Compare
Not sure why CI fails, the new Maven module seems to be set up correctly... Maybe the |
e19f9b5
to
d440a17
Compare
Both profiles (validate and format) are no longer active by default but instead contain activation condition based on presence of java sources in that given submodule. This avoid triggering the plugin on modules such as parent or spec documentation. It also allows the newly introduced module to declare cdi-parent as its parent and inherit all the configs. |
d440a17
to
0428ccd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've done a review of the decisions the auto-formatting rules has made.
Mostly they're good, there were only one or two that left me scratching my head.
However, there are quite a few places where the autoformat has wrapped the text just slightly shorter than the existing code and left a paragraph which just has one or two words alone on a line in the middle of it.
This can't be avoided unless you ask the formatter to remove existing newlines that the author added manually. We probably don't want that so these paragraphs should be reflowed manually (all the line breaks removed and then allow the autoformatter to put them in where it wants them).
api/src/main/java/jakarta/enterprise/inject/spi/BeforeBeanDiscovery.java
Outdated
Show resolved
Hide resolved
api/src/main/java/jakarta/enterprise/inject/spi/InjectionPoint.java
Outdated
Show resolved
Hide resolved
api/src/main/java/jakarta/enterprise/inject/spi/InjectionTarget.java
Outdated
Show resolved
Hide resolved
api/src/main/java/jakarta/enterprise/inject/spi/InjectionTargetFactory.java
Outdated
Show resolved
Hide resolved
api/src/main/java/jakarta/enterprise/inject/spi/InjectionTargetFactory.java
Outdated
Show resolved
Hide resolved
api/src/main/java/jakarta/enterprise/inject/spi/BeanContainer.java
Outdated
Show resolved
Hide resolved
api/src/main/java/jakarta/enterprise/inject/spi/BeanManager.java
Outdated
Show resolved
Hide resolved
api/src/main/java/jakarta/enterprise/inject/spi/BeanManager.java
Outdated
Show resolved
Hide resolved
api/src/main/java/jakarta/enterprise/inject/spi/BeanManager.java
Outdated
Show resolved
Hide resolved
api/src/main/java/jakarta/enterprise/inject/spi/InjectionTarget.java
Outdated
Show resolved
Hide resolved
Thanks for the thorough review!
Like I said, I am not against reformulating them, it's just what I've been working with recently and got used to :)
I didn't pay much attention to the re-flows because in HTML view, this shouldn't really make a difference. |
I don't think I can push directly to the branch since I'm not a committer, so I've opened manovotn#1 with my changes. |
Hm, I didn't realize it won't allow you. |
04bee17
to
53f9b0b
Compare
Break the lines in the InjectionTargetFactory example more intelligently. Signed-off-by: Andrew Rouse <anrouse@uk.ibm.com>
Correct the constructor name in the example, which also causes the formatter to format it correctly. Signed-off-by: Andrew Rouse <anrouse@uk.ibm.com>
Allow (but don't require) the closing parenthesis of a method invocation to be on the following line. Signed-off-by: Andrew Rouse <anrouse@uk.ibm.com>
The autoformat settings will not join lines together which has resulted in some cases where the line lengths are very uneven because the formatter has needed to break a line which was slightly too long. Reflow these paragraphs manually. Signed-off-by: Andrew Rouse <anrouse@uk.ibm.com>
abe7a0d
to
c867b21
Compare
The PR now contains changes from Andrew and is rebased onto |
Fixes #600
This is a suggestion for formatting rules and import sorting which is:
EDIT: I've also created a tracking issue for CDI TCK - jakartaee/cdi-tck#517