export Intellij Idea scala static analysis rules into a scalastyle_configuration file

182 Views Asked by At

I want to keep the predefined static analysis rules from Intellij Idea in a scalastyle_configuration file and run the check at prepush githook in order to enforce those rules across our team. Is there a standard way to do so ?

1

There are 1 best solutions below

2
On BEST ANSWER

IntelliJ inspections aren't based on ScalaStyle. But you can run them standalone or from a CI server using the inspect.sh or inspect.bat scripts from your IntelliJ installation with the following parameters:

  • project file path
  • inspection profile path
  • output path

OSX example:

/Applications/IntelliJ IDEA.app/Contents/bin/inspect.sh ~/IntelliJ IDEAProjects/MyTestProject ~/Library/Preferences/ideaXX/inspection/Default.xml ~/IntelliJ IDEAProjects/MyTestProject/results-dir -v2

For more details, see the documentation on how to run them standalone: https://www.jetbrains.com/help/idea/2016.3/running-inspections-offline.html#d2149225e24

Or from TeamCity: https://confluence.jetbrains.com/display/TCD10/Inspections