I've heard IntelliJ has really good static analysis tools for detecting dead code, improperly initialized variables, etc. However I don't really want the editor baggage, so I was looking for a way to run IntelliJ's static analysis tools on my source code right from the command line.
Is this possible? Is there an interface for running IntelliJ's static analysis tools from the command line?
Go to 'Tools' menu in Intellij IDEA and click on 'Create Command-line Launcher…' Choose a command to add to /user/local/bin . Here I choose idea as command. If you have different versions of Intellij IDEA then it is better to give some suffix to indicate version.
Try Ctrl + Shift + Enter or Cmd + Shift + Enter to run the highlighted commands in debug mode (use the Debug tool window instead of Run). You can use the API provided to implement support for more commands and tools.
Yes, it's possible to run code inspections outside of the IDE. You can also consider using TeamCity product that will do it automatically and will generate nice HTML reports that can be viewed in the browser.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With