Checkstyle

  • Ensure your Java source code is checkstyle compliant with the course configuration file!

To run checkstyle, click on the "checkstyle" button to open its panel. Next, select "226" from the "Rules" dropdown. Finally, click on "Check Project."

What if I don't see the checkstyle button?

Then you have not installed its plugin. Please revisit the reading on logistics.

What if I don't see the cs226 rule?
  • On Mac, open Preferences from the IntelliJ IDEA menu. On Windows, open Settings from the File menu.
  • Search for "checkstyle"; you must find it under the "Tools" heading.
  • Add a new Configuration File, cs226, if it is not already added.
  • Click on + button.
  • For "Description" write "cs226"
  • Select "Use a local Checkstyle file"
  • Browse and select /checkstyle/cs226.xml
  • Check "Store relative to project location"
  • Click "Next" (keep selecting next until it is added).
  • Finally, select cs226 as the "active" configuration file and click on the "Apply" button.

As it can be seen from the demo, the checkstyle complains that the main method in Greeting.java is missing documentation. Add Javadocs to the method and run the checkstyle again.