hivemall icon indicating copy to clipboard operation
hivemall copied to clipboard

Add checkstyle at compile time

Open oza opened this issue 8 years ago • 10 comments

This PR enables compile-time coding style check by using maven-checkstyle-plugin.

Please run:

$ mvn clean compile

and it shows you the warning and error messages, based on Google Java Coding Style in maven-checkstyle-plugin: http://checkstyle.sourceforge.net/google_style.html

https://google.github.io/styleguide/javaguide.html

oza avatar Sep 12 '16 08:09 oza

thanks for your work. Is this test failure expected?

[WARNING] Error injecting: org.apache.maven.plugin.checkstyle.CheckstyleViolationCheckMojo
java.lang.UnsupportedClassVersionError: com/puppycrawl/tools/checkstyle/api/CheckstyleException : Unsupported major.minor version 52.0
    at java.lang.ClassLoader.defineClass1(Native Method)

maropu avatar Sep 12 '16 15:09 maropu

The related topic is #215. Could you let us know the hadoop policy of check styles?

maropu avatar Sep 12 '16 15:09 maropu

You can check Hadoop Coding Style here.

oza avatar Sep 14 '16 00:09 oza

The compile failure is caused since the version of checkstyle plugin only supports JDK8. Re-seinding PR soon to fix it. http://stackoverflow.com/questions/10382929/how-to-fix-java-lang-unsupportedclassversionerror-unsupported-major-minor-versi

oza avatar Sep 14 '16 00:09 oza

okay, thanks.

maropu avatar Sep 14 '16 00:09 maropu

Coverage Status

Coverage increased (+0.3%) to 35.138% when pulling b830f49fec2015e54ce3d78ad416e3812212456b on oza:checkstyle into 2ea7bb3c4589612330a75d627de58e10d668202c on myui:master.

coveralls avatar Sep 14 '16 01:09 coveralls

Coverage Status

Coverage decreased (-0.005%) to 34.855% when pulling b830f49fec2015e54ce3d78ad416e3812212456b on oza:checkstyle into 2ea7bb3c4589612330a75d627de58e10d668202c on myui:master.

coveralls avatar Sep 14 '16 01:09 coveralls

I think we need to at least turn off check-style warning logs for travis-ci because too long logs possibly cause test failures: https://github.com/travis-ci/travis-ci/issues/3865

maropu avatar Sep 14 '16 04:09 maropu

cc: @myui

maropu avatar Sep 14 '16 04:09 maropu

@oza Could you move this PR to https://github.com/apache/incubator-hivemall Thanks.

myui avatar Dec 03 '16 04:12 myui