Is there a better way to configure ScalaStyle under IntelliJ?

The Scala plugin for IntelliJ has some scalar style support. This question is about the best way to configure it to get the scalastyle configuration file, which is usually located in the root of the directory under the name scalastyle-config.xml (example for the Spark project ).

Currently, in order to get the scalastyle plugin in IntelliJ, in order to get our scalastyle configuration, you need to put a copy of it in your .idea folder (supposedly .project will also work, but I have not tested this). In addition, the file must have the name scalastyle_config.xml (with an underscore instead of a hyphen). In short, you need to call the following at the root of your project:

cp scalastyle-config.xml .idea/scalastyle_config.xml

Although I think it is an ugly hack, it at least allows me to see violations in the scalastyle area before building the entire project. Please let me know if you have a better solution for this.

+8
scala intellij-idea scalastyle
source share
1 answer

I found that this now works if you are using IntelliJ 15 and updating the Scala plugin.

The plugin was updated on October 12 to support a configuration file located either in the project root or in the .idea directory. The configuration file can now be named with an underscore or hyphen.

+5
source share

All Articles