javacheckstyle

How can I easily fix Checkstyle errors?


Is there a way to have an IDE fix Checkstyle errors automatically without having to fix each manually?


Solution

  • If you're using Eclipse, yes. You can't correct all problems though. There are two ways:

    1. Right click on the java file in Package Explorer or whatever, and select 'Apply Checkstyle Corrections'.
    2. Click on the error in the problems view, and select 'Quick fix'. This corrects the problem.