Maybe I need a different plugin, which one then?
With Checkstyle Plugin All that remains is to activate the Code cleanup recipe. Activating that recipe in your build file and running rewrite is all you need to do to begin auto-remediating Checkstyle policy violations.
Go to Settings|Editor|Code Style, choose a code style you want to import CheckStyle configuration to. Click on the gear, then 'import scheme', choose "CheckStyle Configuration" and select a corresponding CheckStyle configuration file. Click OK.
Checkstyle is a Open Source development tool to help you ensure that your Java code adheres to a set of coding standards. Checkstyle does this by inspecting your Java source code and pointing out items that deviate from a defined set of coding rules.
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.
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