Skip to content
play

GitHub Action

fix-whitespace-action

v1.2.0 Latest version

fix-whitespace-action

play

fix-whitespace-action

Run fix-whitespace on your repo

Installation

Copy and paste the following snippet into your .yml file.

              

- name: fix-whitespace-action

uses: andreasabel/fix-whitespace-action@v1.2.0

Learn more about this action in andreasabel/fix-whitespace-action

Choose a version

fix-whitespace-action

Run fix-whitespace on your repository. The fix-whitespace tool checks for absense of whitespace violations, which are tabs, trailing whitespace, and lack of newline character at the end of the file. Files which should be checked are specified in the configuration file, typically fix-whitespace.yaml in the repository root.

Standard use:

steps:
  - uses: actions/checkout@v3
  - uses: andreasabel/fix-whitespace-action@v1

This downloads the fix-whitespace binary, installs it into ~/.local/bin and runs it with standard parameters on the repository root.

Example using all parameters:

steps:
  - uses: actions/checkout@v3
  - uses: andreasabel/fix-whitespace-action@v1
    with:
      version:    0.1
      configfile: fix-whitespace.yaml
      fix:        true
      verbose:    true

Setting fix: true fixes whitespace violations in place. Of course, these are fixed only in the checked-out version on the runner. You may be able to push these fixes pack to your repository, e.g., by opening a PR on your repository.

Input version refers to the version of the fix-whitespace program.

With input configfile one can specify the configuration file (defaults to fix-whitespace.yaml).

Exact position of violations can be displayed with verbose: true.