[SPARK-21731][build] Upgrade scalastyle to 0.9.#18943
Conversation
This version fixes a few issues in the import order checker; it provides better error messages, and detects more improper ordering (thus the need to change a lot of files in this patch). The main fix is that it correctly complains about the order of packages vs. classes. As part of the above, I moved some "SparkSession" import in ML examples inside the "$example on$" blocks; that didn't seem consistent across different source files, and avoids having to add more on/off blocks around specific imports. It seems to also have a better header detector, so a few license headers had to be updated to match the expected indentation.
|
Will also test with maven once sbt tests pass. |
|
Test build #80650 has finished for PR 18943 at commit
|
|
Argh, forgot to update the tests... |
|
Test build #80652 has finished for PR 18943 at commit
|
| // $example on$ | ||
| import org.apache.spark.ml.feature.BucketedRandomProjectionLSH | ||
| import org.apache.spark.ml.linalg.Vectors | ||
| import org.apache.spark.sql.SparkSession |
There was a problem hiding this comment.
Oh, I thought SparkSession was intentionally hidden in examples.
There was a problem hiding this comment.
It seems to be in a few examples; but it's not consistent, and this keeps the code cleaner, even if the import is redundant on a spark-shell session.
|
retest this please |
|
Test build #80692 has finished for PR 18943 at commit
|
|
I'm going to push this to avoid having to re-test it before pushing later after more commits are checked in; I tested on the top of master now and there are no new files that need fixing. Merging to master. |
This version fixes a few issues in the import order checker; it provides
better error messages, and detects more improper ordering (thus the need
to change a lot of files in this patch). The main fix is that it correctly
complains about the order of packages vs. classes.
As part of the above, I moved some "SparkSession" import in ML examples
inside the "$example on$" blocks; that didn't seem consistent across
different source files to start with, and avoids having to add more on/off blocks
around specific imports.
The new scalastyle also seems to have a better header detector, so a few
license headers had to be updated to match the expected indentation.