Search code examples
intellij-plugin

Automatically enable custom inspection from IntelliJ Plugin


I've created an IntelliJ plugin with some custom inspections. After going into Settings and enabling all of the inspections manually, they're working fine, but I'd like the inspections to be enabled automatically.

Is there any way of doing this, short of manually reaching into the inspectionProfiless XML and inserting the additional inspection_tool lines? I'd obviously prefer to avoid tweaking config files that may change in the future.


Solution

  • There is enabledByDefault attribute in localInspection (or globalInspection) tag of plugin.xml file. If set to true the inspection will be enabled automatically.