Today, a test file is created in the Spark source directory, just to write the following Scala code:
Package Org.apache.spark
Import org.apache.spark.internal.Logging
import Org.apache.spark.rdd.RDD
Object Test extends Logging {
def main (args:array[string]): unit = {
Loginfo ("haha" + classof[rdd[_])
}
}
Obviously, there is no problem with the code, but there will be a compilation error, so that the Scalastyle_config.xml file into the. Idea directory, put in after the error. So I checked the file: It's a simple, Easy-to-use Code style Detection Tool that's very lightweight. Contribute to team style consistency. It's easy to integrate with Maven. Specific reference: Scalastyle tools
is originally specified in the Scalastyle_config.xml file
<check level= "error" class= "Org.scalastyle.file.HeaderMatchesChecker" enabled= "true" >
Opened the file opening lisence detection. The test code I wrote was not preceded by a lisence comment. This is a bit more about code style, and it's a good idea to find out that style is controlled by code-style tools.
Before writing code, style all rely on their own control, everyone in SVN submitted code style is different, is not conducive to collaborative programming, the code is also more confusing. But with the code style gadget, it can have a certain binding effect. function is important, code style and later maintainability are also important. Find some code style related articles on the Internet, such as saving Java Code style obsessive-compulsive disorder Zhouyu has just given some more extensive discussion, in addition to local style control in the developer, but also in the submission of code to the good code style. The use of the Checkstyle Check Coding specification provides a way to install the Checkstyle plugin under the mainstream IDE (Idea and Eclipse).
In a word, the gadgets that make it easy for developers to work are not to be overlooked.