myui / hivemall

Scalable machine learning library for Apache Hive/Spark/Pig
http://hivemall.incubator.apache.org/
503 stars 153 forks source link

Add checkstyle at compile time #343

Open oza opened 8 years ago

oza commented 8 years ago

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

maropu commented 8 years ago

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 commented 8 years ago

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

oza commented 8 years ago

You can check Hadoop Coding Style here.

oza commented 8 years ago

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

maropu commented 8 years ago

okay, thanks.

coveralls commented 8 years ago

Coverage Status

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

coveralls commented 8 years ago

Coverage Status

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

maropu commented 8 years ago

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 commented 8 years ago

cc: @myui

myui commented 7 years ago

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