checkstyle tool to enforce Sun/Oracle code standard on openJdk
Roman Ivanov
ivanov-jr at mail.ru
Sun Jan 4 07:20:12 UTC 2015
Hi Jon,
first of all lets deside on last version of "Code Standard", as it might be appeared that changes will be cosmetic.
It might be reasonble to configure Checkstyle to enforce Code Standard on young/new projects or part of the project.
If project have a lot of backporting and it might be reasonable to enforce Code Standard only in latest code - version 9, and all previous version keep as is.
It also might be reasonable to after config is created, start to use it partly, and slowly increase amount of rules as project have time to resolve style stuff.
The main point - old code/files stay unchanged, new files are created to follow all rules 100%, no backporting problems are guaranteed.
thanks,
Roman Ivanov
> As attractive as the idea might be, it is not a slam dunk good idea to
> update the code base to a consistent style.
>
> OpenJDK spans multiple versions, and patches get backported between
> versions. And there are always many projects "in-flight" at any time, at
> varying stages of development. Doing wholesale style-cleanup can cause
> undue difficulties when trying to port changesets or merge lines of
> development.
>
> I'm not saying it shouldn't be done; but if it is done, it should be
> done carefully, in a considered manner, at an appropriate time. Also,
> we should consider the relative importance of the fixes. For example,
> fixing lint and doclint warnings that might indicate problematic code
> and comments is more important that fixing errors in whitespace indentation.
>
> -- Jon
>
> On 12/30/2014 01:07 AM, Roman Ivanov wrote:
>> Hi OpenJdk engineers,
>>
>> I am owner of Checkstyle project - http://checkstyle.sourceforge.net/index.html .
>>
>> We had Sun code standard configuration that allow developers
>> write code in the same approach as authors of Java do.
>> But a lot of time passed from time that configuration is
>> introduced, and I am not completely sure that we do complete
>> and accurate in coverage of Sun Java Standard.
>>
>> This year we did complete code coverage for Google's style -
>> http://checkstyle.sourceforge.net/google_style.html
>>
>> Guava team already agreed on fixing problems
>> and updating style guide to be more precise in some requirements -
>> https://github.com/google/guava/issues/1891
>>
>> I have an idea to create similar page for Sun/Oracle style -
>> http://checkstyle.sourceforge.net/sun_style.html
>>
>> Checkstyle already detected a lot of problem in javadoc on openjdk9 (base on change set: 11061:9ade71a206f9 ) -
>> http://checkstyle.sourceforge.net/reports/javadoc/openjdk9/
>> That report contains only problems of Javadoc but it could be as full as report over Guava - http://checkstyle.sourceforge.net/reports/google-style/guava/.
>>
>> Are you interested in such automatic validation of Sun/Oracle Code Standard ?
>> To let openJDK comply their own code standard :), let automatically validate any contributions to project .
>>
>> thanks,
>> Roman Ivanov
More information about the discuss
mailing list