How to make the error detected by a local inspection tool to prevent compilation?
I have built a local inspection tool that can detect some issues and mark then as error. I hope if such error exists and is detected, the project will not be allowed to compile, just like other syntax errors. Could anyone shed some light on how to achieve this goal? I found a post that pointed to InspectionValidator, and I have created one in my plugin. However, only the constructor of my inspection validator is called. Does anyone know what could be the problem?
Please sign in to leave a comment.
I am also looking for a way to add inspections into the build. It would be hugely helpful if we could fail the build if any inspections fail. Validators initially looked promising, especially if they can somehow be used to run inspections. Tianshil, what I did find out there was this class:
InspectionValidatorWrapper.java
Maybe this is what you need to launch an inspection from a validator? I'm not sure though. It would be nice to be able to launch an entire suite of inspections defined in an inspection profile as part of the build though, not just one inspection at a time. Unfortunately I'm not a JetBrains expert so unsure whether this is possible.