Scalastyle is a style checker for
Scala. It checks your Scala code against a number of configurable
rules, and marks the code which violates these rules with warning or
error markers in your source code.
Lets add scalastyle plugin in 4 steps.
- Install Scalastyle plugin
- Add Scalastyle Nature to your project
- Set up a configuration for Scalastyle
- Enable Scalastyle for that project
- Install Scalastyle plugin
- From Eclipse Marketplace install Scala Style 0.9.0
- Accept the terms and conditions. Scalastyle is installed in your eclipse.
- Add Scalastyle Nature to your project
Right click project → ScalaStyle →
Add Scalastyle nature
- Set up a configuration for Scalastyle
- Now we need to download the configuration rules from scalastyle.org
- Place this file in your project, where the eclipse can access the file eg: project/src/main/resource/scalastyle_config.xml
- Add configuration file to list of available configuration
In eclipse windows preference → select
scalastyle
configuration page → you can then add the file path of configuration file .
configuration page → you can then add the file path of configuration file .
- Enable Scalastyle for that project
- Finally we need to select the configuration for our project
- Do a project clean and build, and you should see Scalastyle errors appear in your problems view or in the source code.