[TIMOB-18621] Consolidate Java coding standards
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | High |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Android |
Labels | n/a |
Reporter | Ingo Muschenetz |
Assignee | Unknown |
Created | 2015-02-27T18:56:49.000+0000 |
Updated | 2018-02-28T19:55:36.000+0000 |
Description
We have several different coding standards in use that may or may not differ from our official standards, and are somewhat different from our other languages:
https://wiki.appcelerator.org/display/guides2/Java+Coding+Standards
Some highlights of cross-language similarity I'd like to achieve:
* Tabs
* Opening brace on new line, except blocks and flow control
* Closing brace on new line (except blocks and flow control, i.e. } else {)
* Max line length of 120 (to fit within a normal GitHub review window)
A proposed formatting file for Eclipse can be found here:
https://github.com/appcelerator/appc-standards/blob/master/languages/java/eclipse-format.xml
And below are two examples of what this would change in our code:
* Studio: https://github.com/aptana/studio3/pull/297
* Titanium: https://github.com/appcelerator/titanium_mobile/pull/6668
[~cwilliams] [~pinnamuri] [~kkolipaka] [~hpham] [~pec1985] Thoughts appreciated.