CheckStyle plugin for IDEA - java way of warnings

2019-02-07 06:43发布

问题:

  1. Is it possible to make it present the list of warnings java/spellchecker style as opposed to a old school list of errors with line numbers?
  2. Can it automatically fix things like missed space near '=' etc?

Maybe I need a different plugin, which one then?

回答1:

Try QAPlug - Checkstyle plugin. Then go Analyze - Analyze Code (not the standard Analyze!) then click "..." near Run with chosen profile select a concrete profile and press the import button.

In the next dialog select the checkstyle rules file and then click the OK button. That's it. Just wait for the results. I got something like this.

That plugin has its limitations however. For example, I didn't manage to use a file with suppressions with it.

You can also use the plugin CheckStyle-IDEA which also has good configurations and allows you to use suppressions, custom checks and displays the inspection warnings in the editor immediately, but to apply that you need to set Project Settings - Inspections - CheckStyle - Real-Time Scan in the IDE settins.

Answering the second question, I didn't find any automatical reformat capabilities in these plugins, just checks.