-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-14868][BUILD] Enable NewLineAtEofChecker in checkstyle and fix lint-java errors #12632
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Test build #56783 has finished for PR 12632 at commit
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why can't this be final?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, it's definitely final. It's just RedundantModifier error since the class SignedPrefixComparator is already final.
|
Hi, @rxin . Thank you for review. FYI, here is the result of spark:master$ dev/lint-java
Using `mvn` from path: /usr/local/bin/mvn
Checkstyle checks failed at following occurrences:
[ERROR] src/main/java/org/apache/spark/shuffle/sort/ShuffleExternalSorter.java:[259] (sizes) LineLength: Line is longer than 100 characters (found 103).
[ERROR] src/main/java/org/apache/spark/util/collection/unsafe/sort/PrefixComparators.java:[25,8] (imports) UnusedImports: Unused import - org.apache.spark.util.Utils.
[ERROR] src/main/java/org/apache/spark/util/collection/unsafe/sort/PrefixComparators.java:[72,17] (modifier) ModifierOrder: 'abstract' modifier out of order with the JLS suggestions.
[ERROR] src/main/java/org/apache/spark/util/collection/unsafe/sort/PrefixComparators.java:[85,22] (modifier) RedundantModifier: Redundant 'final' modifier.
[ERROR] src/main/java/org/apache/spark/util/collection/unsafe/sort/PrefixComparators.java:[86,22] (modifier) RedundantModifier: Redundant 'final' modifier.
[ERROR] src/main/java/org/apache/spark/util/collection/unsafe/sort/PrefixComparators.java:[88,12] (modifier) RedundantModifier: Redundant 'final' modifier.
[ERROR] src/main/java/org/apache/spark/util/collection/unsafe/sort/PrefixComparators.java:[94,22] (modifier) RedundantModifier: Redundant 'final' modifier.
[ERROR] src/main/java/org/apache/spark/util/collection/unsafe/sort/PrefixComparators.java:[95,22] (modifier) RedundantModifier: Redundant 'final' modifier.
[ERROR] src/main/java/org/apache/spark/util/collection/unsafe/sort/PrefixComparators.java:[97,12] (modifier) RedundantModifier: Redundant 'final' modifier.
[ERROR] src/main/java/org/apache/spark/util/collection/unsafe/sort/PrefixComparators.java:[103,22] (modifier) RedundantModifier: Redundant 'final' modifier.
[ERROR] src/main/java/org/apache/spark/util/collection/unsafe/sort/PrefixComparators.java:[104,22] (modifier) RedundantModifier: Redundant 'final' modifier.
[ERROR] src/main/java/org/apache/spark/util/collection/unsafe/sort/PrefixComparators.java:[106,12] (modifier) RedundantModifier: Redundant 'final' modifier.
[ERROR] src/main/java/org/apache/spark/util/collection/unsafe/sort/PrefixComparators.java:[112,22] (modifier) RedundantModifier: Redundant 'final' modifier.
[ERROR] src/main/java/org/apache/spark/util/collection/unsafe/sort/PrefixComparators.java:[113,22] (modifier) RedundantModifier: Redundant 'final' modifier.
[ERROR] src/main/java/org/apache/spark/util/collection/unsafe/sort/PrefixComparators.java:[115,12] (modifier) RedundantModifier: Redundant 'final' modifier.
[ERROR] src/main/java/org/apache/spark/util/collection/unsafe/sort/RadixSort.java:[19] (regexp) RegexpSingleline: No trailing whitespace allowed.
[ERROR] src/main/java/org/apache/spark/util/collection/unsafe/sort/RadixSort.java:[230] (regexp) RegexpSingleline: No trailing whitespace allowed.
[ERROR] src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeExternalSorter.java:[215] (sizes) LineLength: Line is longer than 100 characters (found 103).
[ERROR] src/main/java/org/apache/spark/sql/execution/datasources/parquet/SpecificParquetRecordReaderBase.java:[41,8] (imports) UnusedImports: Unused import - org.apache.hadoop.fs.FileSystem.
[ERROR] src/test/java/org/apache/spark/ml/classification/JavaRandomForestClassifierSuite.java:[84,26] (misc) ArrayTypeStyle: Array brackets at illegal position.
[ERROR] src/test/java/org/apache/spark/ml/classification/JavaRandomForestClassifierSuite.java:[88,29] (misc) ArrayTypeStyle: Array brackets at illegal position.
[ERROR] src/test/java/org/apache/spark/ml/classification/JavaRandomForestClassifierSuite.java:[92,29] (misc) ArrayTypeStyle: Array brackets at illegal position.
[ERROR] src/test/java/org/apache/spark/ml/regression/JavaRandomForestRegressorSuite.java:[84,26] (misc) ArrayTypeStyle: Array brackets at illegal position.
[ERROR] src/test/java/org/apache/spark/ml/regression/JavaRandomForestRegressorSuite.java:[88,29] (misc) ArrayTypeStyle: Array brackets at illegal position.
[ERROR] src/test/java/org/apache/spark/ml/regression/JavaRandomForestRegressorSuite.java:[92,29] (misc) ArrayTypeStyle: Array brackets at illegal position. |
|
Can we turn lint-java on for Jenkins in this pr? |
|
Sure! It's just one line change. May I turn it one right now? |
|
Test build #56837 has finished for PR 12632 at commit
|
|
Interesting. @rxin . Jenkins is trying to use Maven 3.1.1 due to the mismatch between Actually, my PR #12631 aims to handle that bug. Could you review that too? |
|
I reverted the last commit about Jenkins Java Linter. |
|
Test build #56838 has finished for PR 12632 at commit
|
|
It seems irrelevant errors. I'll rebase this to trigger again. |
|
Test build #56856 has finished for PR 12632 at commit
|
|
Since the failed tests are disabled at 0c8e533, I rebased again. |
|
Test build #56864 has finished for PR 12632 at commit
|
|
Hi, @rxin . |
|
Merging in master. |
|
Thank you, @rxin . |
What changes were proposed in this pull request?
Spark uses
NewLineAtEofCheckerrule in Scala by ScalaStyle. And, most Java code also comply with the rule. This PR aims to enforce the same ruleNewlineAtEndOfFileby CheckStyle explicitly. Also, this fixes lint-java errors since SPARK-14465. The followings are the items.How was this patch tested?
After the Jenkins test succeeds,
dev/lint-javashould pass. (Currently, Jenkins dose not run lint-java.)$ dev/lint-java Using `mvn` from path: /usr/local/bin/mvn Checkstyle checks passed.