fix-whitespace: Fixes whitespace issues.

[ library, mit, program, text ] [ Propose Tags ]

Removes trailing whitespace, lines containing only whitespace, expands tabs, and ensures that every file ends in a newline character.


[Skip to Readme]

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.0.5, 0.0.6, 0.0.7, 0.0.8, 0.0.9, 0.0.10, 0.0.11, 0.1
Change log CHANGELOG.md
Dependencies base (>=4.9.0.0 && <5), directory (>=1.2.6.2 && <1.4), extra (>=1.1 && <2.0), filepath (>=1.4.1.0 && <1.5), filepattern (>=0.1.3 && <0.2), fix-whitespace, text (>=1.2.3.0 && <1.3 || >=2.0 && <2.2), transformers (>=0.5.2.0 && <0.7), yaml (>=0.8.4 && <0.12) [details]
License MIT
Author fix-whitespace was originally written by Nils Anders Danielsson as part of Agda 2 with contributions from Ulf Norell, Andrés Sicard-Ramírez, Andreas Abel, Philipp Hausmann, Jesper Cockx, Vlad Semenov, Liang-Ting Chen, and Artem Pelenitsyn.
Maintainer Andreas Abel, Liang-Ting Chen <liang.ting.chen.tw@gmail.com>
Revised Revision 1 made by AndreasAbel at 2023-12-28T15:39:33Z
Category Text
Home page https://github.com/agda/fix-whitespace
Bug tracker https://github.com/agda/fix-whitespace/issues
Source repo head: git clone https://github.com/agda/fix-whitespace.git
Uploaded by AndreasAbel at 2023-08-07T16:25:15Z
Distributions LTSHaskell:0.1, NixOS:0.1, Stackage:0.1
Executables fix-whitespace
Downloads 1309 total (36 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2023-08-07 [all 1 reports]

Readme for fix-whitespace-0.1

[back to package description]

fix-whitespace: Fixes whitespace issues

Hackage version fix-whitespace on Stackage Nightly Stackage LTS version Build status Haskell-CI

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 --help

    Show this help information.

  • -v --verbose

    Show files as they are being checked. Since 0.1: Display location of detected whitespace violations.

  • -V --version

    Show program's version.

  • --config=CONFIG

    Override the project configuration fix-whitespace.yaml.

  • --tab=TABSIZE

    Expand tab characters to TABSIZE (default: 8) many spaces. Keep tabs if 0 is given as TABSIZE. (Option available since 0.0.9.)

  • --check

    With --check the 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.

Continuous integration

fix-whitespace comfortably integrates into your GitHub CI via the fix-whitespace-action.