Checkstyle development tool

From Opentaps Wiki
Jump to navigationJump to search

Checkstyle is a development tool to help programmers write Java code that adheres to a coding standard. It automates the process of checking Java code to spare humans of this boring (but important) task.

Using Checkstyle development tool with Eclipse

As first step you have to install the Eclipse Checkstyle Plug-in via the update site.

  • Within Eclipse go to Help->Software Updates->Available Software
  • Create new update site with Add Site... button.
  • Input a name to your liking (for instance Checkstyle Plug-in) and input the following URL:
  • Click your way through the following pages to install the plug-in.

Follow this guide and create opentaps check configuration. Select External Configuration File and choose opentaps check config file location.

Enable Checkstyle for a project as described on

Depending on project size Checkstyle, working as project builder, can occupy a lot of memory. If required resources become a problem you can deactivate it for project and still have possibility check source file manually. Select Checkstyle->Check Code with Ckeckstyle in Package Explorer context menu for any java (or properties) file.

A better solution is to only activate Checkstyle for the files opened in the editor. To do that go to the project Properties > Checkstyle and check Exclude from checking: files not opened in editor.

Using Checkstyle development tool with IntelliJ IDEA

Install the Checkstyle plugin from the list of available plugins, which is located at Preferences -> IDE Settings -> Plugins -> Available. Restart IDEA to load the plugin.

Once installed, you can find the Checkstyle configuration under Preferences -> Project Settings -> CheckStyle Plugin. Opentaps 1.0 comes with a checkstyle definition file in the root directory named opentaps_checks.xml.

A new button named CheckStyle Scan should appear on the bottom toolbar. You can use this to scan for style problems.

Source and documentation for this plugin is located at,