I'm searching for an automated way to collect all the IntelliJ static code analysis warnings (compiler and inspections) without having to run a UI and click on buttons. Ideally I'd like run the IntelliJ compiler from the command line and have it log all warnings into a file. Is this possible?
Taken from Working with IntelliJ IDEA Features from Command Line:
To launch a code inspection from the command line, specify the following command line arguments:
- Path to the launcher: specify the full path to one of the following launchers (which reside under the bin directory of your IntelliJ IDEA installation):
- For Windows:
inspect.bat
- For UNIX :
inspect.sh
- Project file path is the full path to the *.ipr file or .idea directory of the project to be inspected.
- Inspection profile path is the full path to the profile, against which the project should be inspected. The inspection profiles are stored under
USER_HOME\.IntelliJ IDEAXX\config\inspection
- Output path is the full path to an existing directory where the report will be stored.
- Options. You can specify: The directory to be inspected -d The verbosity level of output -vX, where X is 0 for quiet, 1 for noisy and 2 for extra noisy.
Please note that you have to specify full paths, relative paths are not accepted.