fest-assert-2.x
fest-assert-2.x copied to clipboard
Ensure code in master branch follows coding standards and formatting
Found org.fest.assertions.internal.Arrays#assertHasSameSizeAs()
No formatting applied at all.
Goal:
- define at least formatting rules
- apply them automatically before each commit
- don't accept code which does not follow formatting rules (no pull)
Ideally, we should have some coding standards, too (not only mere formatting)
agreed, we have a contributor guide in the github wiki with eclipse formatting rules (that we may update btw) we miss the idea formatting rules.
you could give these IntelliJ Idea settings (code style only) a try: https://docs.google.com/open?id=0BykO0Q46iG-mWVBaNjlvZnJnTFU They are based on the current sources, but as expected they don't exactly fit. Expecially a rule regarding whitespaces at line ends would be necessary in Eclipse, but there are some other details missing.
I have added your file in github and mentioned it in the contributor guide. It is here : https://github.com/alexruiz/fest-assert-2.x/blob/master/src/formatters/fest-idea-formatter.xml
thanks !
"Son of external code formatter" is an IntelliJ IDEA Plugin capable of re-using Eclipse Code Formatter to do code formatting in IDEA.
We could:
- define code style in Eclipse (it's the "master" for code style)
- have IDEA format code by using the plugin + exported code style of eclipse
This way, the formatting in Eclipse and IDEA should be exactly the same. This should be tested a bit IMHO.
Seems fine to me !
As Ansgar already mentioned, the reference code style could be applied automatically on each commit. Addionally, I would suggest to apply the code style on all repositories once now, so that we can be sure that the upstream repos with their master branches are clean and patches from other contributors can safely use the provided code formats.
I agree with that, this is something I should have done long time ago, before we start having contribution again.
The fest assert 2.x codebase has different formatting standard than the 1.x but only Alex had the 2.x formatting preferences and as he was not available when I started to contribute on the 2.x so I kept using the 1.x format which is the one that is committed.
Anyway, unless Ansgar disagree, I will format all the code this week.
You should look into the maven-checkstyle-plugin. It will fail the build on poorly (or incorrectly) formatted code. Combine this with services like CloudBees' BuildHive and you'll get comments on new pull requests with whether or not they build successfully.