-
Notifications
You must be signed in to change notification settings - Fork 197
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
Formatted source code using Apache Commons standards. #23
Conversation
Although this a good step to standardisation I wondered if there is a way to achieve the same in a maven plugin so that those not using eclipse can be compliant? A quick check found this formatter-maven-plugin which is built on top of the eclipse formatter. Could you have a look and see if it works when added to the pom for the code in this PR. I.e. you should be able to run If it works then the |
@aherbert Let me try that and I will report back. |
@aherbert it worked like a charm. In fact it picked up directories I missed because I assumed Eclipse recursed directories when it formatted but it did not. but the Plugin does and picks up the whole source tree. |
I think that the eclipse formatter will recurse the directory if you start at a resource folder (e.g. src/main/java). But if you start at a package in the directory tree below the top level (e.g. org.apache.commons.beautils2) then it only processes those java files in the current package. Have you looked at how the formatter treated comments. I see that you have configured it to allow formatting in javadoc comments. In my experience this is not good for compact lists:
Becomes:
The javadoc will still render the same but anyone reading the source file will struggle. So I would recommend you have a scan through the code for You can solve this by adding spaces:
becomes:
Basically just stripping leading whitespace. Also check what it has done in |
I tested /**
* Test method.
*
* <ul>
* <li>This
* <li>list
* </ul>
*/ became this... /**
* Test method.
* <ul>
* <li>This
* <li>list
* </ul>
*/ |
Closing this PR. Will create a new one |
Using the Eclipse formatter provided in the previous PR.