diff options
author | Dongjoon Hyun <dongjoon@apache.org> | 2016-03-21 07:58:57 +0000 |
---|---|---|
committer | Sean Owen <sowen@cloudera.com> | 2016-03-21 07:58:57 +0000 |
commit | 20fd254101553cb5a4c932c8d03064899112bee6 (patch) | |
tree | 25b1dd840cd2ec27fd875c3b52987d502e6423f5 /dev | |
parent | e474088144cdd2632cf2fef6b2cf10b3cd191c23 (diff) | |
download | spark-20fd254101553cb5a4c932c8d03064899112bee6.tar.gz spark-20fd254101553cb5a4c932c8d03064899112bee6.tar.bz2 spark-20fd254101553cb5a4c932c8d03064899112bee6.zip |
[SPARK-14011][CORE][SQL] Enable `LineLength` Java checkstyle rule
## What changes were proposed in this pull request?
[Spark Coding Style Guide](https://cwiki.apache.org/confluence/display/SPARK/Spark+Code+Style+Guide) has 100-character limit on lines, but it's disabled for Java since 11/09/15. This PR enables **LineLength** checkstyle again. To help that, this also introduces **RedundantImport** and **RedundantModifier**, too. The following is the diff on `checkstyle.xml`.
```xml
- <!-- TODO: 11/09/15 disabled - the lengths are currently > 100 in many places -->
- <!--
<module name="LineLength">
<property name="max" value="100"/>
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
</module>
- -->
<module name="NoLineWrap"/>
<module name="EmptyBlock">
<property name="option" value="TEXT"/>
-167,5 +164,7
</module>
<module name="CommentsIndentation"/>
<module name="UnusedImports"/>
+ <module name="RedundantImport"/>
+ <module name="RedundantModifier"/>
```
## How was this patch tested?
Currently, `lint-java` is disabled in Jenkins. It needs a manual test.
After passing the Jenkins tests, `dev/lint-java` should passes locally.
Author: Dongjoon Hyun <dongjoon@apache.org>
Closes #11831 from dongjoon-hyun/SPARK-14011.
Diffstat (limited to 'dev')
-rw-r--r-- | dev/checkstyle-suppressions.xml | 10 | ||||
-rw-r--r-- | dev/checkstyle.xml | 5 |
2 files changed, 10 insertions, 5 deletions
diff --git a/dev/checkstyle-suppressions.xml b/dev/checkstyle-suppressions.xml index 9242be3d03..a1a88ac8cd 100644 --- a/dev/checkstyle-suppressions.xml +++ b/dev/checkstyle-suppressions.xml @@ -28,6 +28,12 @@ --> <suppressions> -<suppress checks=".*" - files="core/src/main/java/org/apache/spark/util/collection/TimSort.java"/> + <suppress checks=".*" + files="core/src/main/java/org/apache/spark/util/collection/TimSort.java"/> + <suppress checks=".*" + files="sql/core/src/main/java/org/apache/spark/sql/api.java/*"/> + <suppress checks="LineLength" + files="src/test/java/org/apache/spark/sql/hive/test/Complex.java"/> + <suppress checks="LineLength" + files="src/main/java/org/apache/spark/examples/JavaLogQuery.java"/> </suppressions> diff --git a/dev/checkstyle.xml b/dev/checkstyle.xml index 2261cc95d4..b66dca9041 100644 --- a/dev/checkstyle.xml +++ b/dev/checkstyle.xml @@ -76,13 +76,10 @@ <property name="allowByTailComment" value="true"/> <property name="allowNonPrintableEscapes" value="true"/> </module> - <!-- TODO: 11/09/15 disabled - the lengths are currently > 100 in many places --> - <!-- <module name="LineLength"> <property name="max" value="100"/> <property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/> </module> - --> <module name="NoLineWrap"/> <module name="EmptyBlock"> <property name="option" value="TEXT"/> @@ -167,5 +164,7 @@ </module> <module name="CommentsIndentation"/> <module name="UnusedImports"/> + <module name="RedundantImport"/> + <module name="RedundantModifier"/> </module> </module> |