This tool can keep your project and repository clean of trailing whitespace and missing terminal newline.
Usage: fix-whitespace [-h|--help] [-v|--verbose] [-V|--version] [--check] [--config CONFIG] [FILES]
The program does the following to files specified in FILES or in the
configuration file fix-whitespace.yaml under the current directory
(and its subdirectories):
- Remove trailing whitespace.
- Remove trailing lines containing nothing but whitespace.
- Ensure that the file ends in a newline character.
- Expand tabs to spaces (optionally).
Available options:
-
-h --helpShow this help information.
-
-v --verboseShow files as they are being checked. Since 0.1: Display location of detected whitespace violations.
-
-V --versionShow program's version.
-
--config=CONFIGOverride the project configuration
fix-whitespace.yaml. -
--tab=TABSIZEExpand tab characters to TABSIZE (default: 8) many spaces. Keep tabs if 0 is given as TABSIZE. (Option available since 0.0.9.)
-
--checkWith
--checkthe program does not change any files, it just checks if any files would have been changed. In the latter case, it returns with a non-zero exit code.
For an example configuration file see the one of Agda.
fix-whitespace comfortably integrates into your GitHub CI via the fix-whitespace-action.