FSLint

Redundant Whitespaces

FSlint can check text files for a number of whitespace issues, such as unnecessary tabs and spaces. This is a feature that is very useful for programmers and writers who need to be aware of the whitespace within their files. The average user may never need to use this, but knowing about this tool could still be beneficial.

Graphical Interface

Ch12.01___BadWhiteSpace.png
The checkbox for "bad indenting for indent width" can check text files to ensure that the indenting width is uniform and matches the desired number count specified. FSlint can also check for whitespace at the end of a line with the checkbox to the far right labelled "whitespace at end of line".  The "Clean" button will attempt to fix the whitespace issues in the selected files.

In this example the file Badwhitespace is as follows:
This_file__
Has_lots___
of_extra__
whitespace__

All spaces have been replaced with underscores for visibility purposes. When FSlint is allowed to clean this file, the following is produced:
This_file
Has_lots
of_extra
whitespace

Further advanced options for cleaning can be completed by the FSlint command line utility.

Command Line Interface

The command line interface to this utility is 'findrs'. This utility will be found in the installation directory of fslint.

$ /usr/share/fslint/fslint/findrs --help
 find Redundant whiteSpace.
 Usage: findrs [-w] [-t[#]] [-c] [[-r] [-f] paths(s) ...]
 
 -w enables mode to report whitespace at the end of lines.
 This is the default mode if none specified.

 -t enables mode to report erroneous mixing of indenting
 spaces and tabs (on a single line).
 If a number is passed to -t it sets the width of the tabs,
 which allows for more thorough checking.

 If -c specified then the number of lines in each file,
 with problematic whitespace is reported, in addition
 to the file names. Note this will take longer.

 If --view specified then the erroneous whitespace found
 is highlighted using vim.

 If no path(s) specified then the current directory is assumed.