Doublestrike wrote:Sorry to open an "old" discussion, but this thread sort of tailed off without any resolution.
It seems people are generally in favor of consistently formatted code, and have made several non-conflicting suggestions about guidelines. With the great organization/standards that Maven and Mantis bring to the table, it seems a logical/professional move to use an agreed set of checkstyles, and mold the code to fit over time.
Anyway, should I be making an effort to follow the current checkstyle, or is it going to change in the future? Incidentally, I'd be happy to do some time correcting formatting "errors" should there be any guidelines decided upon.
i exspect this thread's Ressurection any time someone has issues with the CheckStyle or Eclipse settings for style.
mantis has little to do with style. it is more about reducing bug reports and feature requests in the forums. last i heard, the plan was to retire the Current Known Bugs List {and possibly other topics} once we had worked out the bugs and inconsistencies between the internal bug reporter and the english guide for reporting bugs. to maintain comfort for those using the forum, they can post bug reports for the latest beta release in the announcement thread for that release. this would prevent enormous threads from forming.
maven's role in this is to generate reports for public ridicule.
some people have been moulding the code to fit over time, yes. the checkstyle plugin is optional, and it still allows violations. it installed, it flags them as errors. but they act more like warnings.
for new files, please follow checkstyle for the entire file. i doubt the style config will change too much in the future. if it does, it will probably be
less stringent, so your efforts are not wasted.
when you edit a block of code somewhere else, or if you rename a file, follow checkstyle for the lines you are editing. please resist the urge to fix all formatting in the file. after you've tested and committed the file(s), you can then go back and fix checkstyle errors in a separate commit. (i just committed a setting change to rev 10014 that makes this easier. {previously it was ignoring certain files, including freshly committed ones. you
still have to open a file in the editor to see its checkstyle errors.}}
i would suggest
against changing the style of any other files at this time.
as of rev 9980, if you use Eclipse, the default comments and code it generates {like when you tell Eclipse to create a class or a method} are more in line with checkstyle.
many times i've noticed the checkstyle plugin gives false errors about files not ending in newline. also, it doesn't like many the classes in src/test/java/, because they lack package-info. if your file has one or two newlines at the end, you can ignore these so called errors.