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 ?
Asked
Active
Viewed 168 times
3
-
Do you mean you want to run IntelliJ inspections via Scalastyle? – Justin Kaeser Jan 02 '17 at 13:07
-
Yes, exactly. i'ts also fine to enforce other standard code style like twitter's via Scalastyle – NetanelRabinowitz Jan 04 '17 at 15:13
1 Answers
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
-
Is there any way to run them from bitbucket pipeline or jenkins ? – NetanelRabinowitz Jan 18 '17 at 19:03
-
Sure, the same you would run any script. You just need the inspection profile to be available on the server. – Justin Kaeser Jan 19 '17 at 11:50