3

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 ?

NetanelRabinowitz
  • 1,534
  • 2
  • 14
  • 26

1 Answers1

1

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

Justin Kaeser
  • 5,868
  • 27
  • 46