Eclipse Checkstyle Plug-in

Getting Started
There are only a few things you need to do to get up and running using the Checkstyle plug-in. The first thing is to understand a few basic concepts about how the plug-in works.

Basic Concepts
The Checkstyle plug-in works with two basic objects, a Check Configuration and a File Set. A Check Configuration specifies which check rules you want to inspect your code, the configuration settings for each rule, and the severity level of the message if the rule finds a problem. Once defined a Check Configuration is saved in your workspace and can be used accross multiple projects. The Checkstyle plug-in comes with one or more Check Configurations already defined. To see/modify the pre-defined Check Configurations or to create your own go to Window -> Preferences -> Checkstyle.

A File Set is a collection of files within one project that need to be checked with the same Check Configuration. A File Set is defined using regular expressions to select the files to include and exclude from the File Set. A File Set also references the Check Configuration to use when checking its files. File Sets are defined for each project by right clicking on the project and selecting Properties -> Checkstyle.

My First Code Check
The following steps will guide you through your first code check using Checkstyle.

  1. Review the pre-defined Check Configurations, modify them, or define you own. For detailed instructions see Configuring Check Configurations.
  2. Enable Checkstyle on your project by creating one or more File Sets. For detailed instructions see Configuring File Sets.
  3. Upon closing the project properties window a new build should be triggered that will include a code check. If a build is not triggered automatically select Project -> Rebuild Project.
  4. Any problems Checkstyle finds in your Java source code will be listed in the Tasks view.

Copyright © 2002-2004 David Schneider. All Rights Reserved.