HomeUser GuideDevelopmentDownloadLegal

Development: checkspace

Description

Checks files for space characters at the beginning of lines.

When working in a team or with different platforms/editors it happens that files are indented with spaces instead of tabs. This is particularly annoying if you have decided to use tabs exclusively.

This task simply validates a bunch of files and checks if the whitespace characters at the beginning of the lines solely consist of tabs.

There is one small exception to the rule mentioned above, comments. When adding a JavaDoc comment you usually indent with tab characters and the add one single space and one single star as in the following example:

/**
 * Hello World
 */

The checkspace task recognizes this and ignores such cases. In all other cases a space character at the beginning of a line is reported!

Parameters

This task does not have any parameter attributes.

Nested Elements

This task supports the following nested elements.

fileset

The usual Ant fileset, as you now it e.g. from the copy task.

Examples

<checkspace>
  <fileset dir="${project.src.dir}">
    <include name="**/**.java"/>
  </fileset>
  <fileset dir="${project.dir}">
    <include name="**/**.xml"/>
    <exclude name="dist/**"/>
    <exclude name="build/**"/>
    <exclude name="doc/**"/>
    <exclude name="**/changelog.xml"/>
    <exclude name="**/doc/text/*.xml"/>
    <exclude name="**/*-version.xml"/>
  </fileset>
</checkspace>