There's some scalastyle support in the Scala plugin for IntelliJ. This question is about the best way to set it up to pick up a scalastyle configuration file which is customarily at the root of the directory under the name scalastyle-config.xml
(example for the Spark project).
Currently, to get the scalastyle plugin in IntelliJ to pickup our scalastyle config, you need to put a copy of it into your .idea
folder (supposedly .project
would also work, but I haven’t tested this). Also, the file needs to be named scalastyle_config.xml
(with an underscore instead of the hyphen). In short, you need to call the following in the root of your project:
cp scalastyle-config.xml .idea/scalastyle_config.xml
While I think this is an ugly hack, it at least allows me to see the scalastyle violations before building the whole project. Please let me know if you have a better solution for this.