A utility that checks for consistent whitespace across your file(s).
Check the current directory for consistent whitespace:
consistent_whitespaceCheck specific files or directories:
consistent_whitespace path/to/file.txt path/to/directory/By default, the tool accepts either tabs or spaces as long as they are consistent within each file. You can enforce specific whitespace types:
consistent_whitespace --whitespace spaces
consistent_whitespace --whitespace tabs
consistent_whitespace --whitespace eithername: Continuous Integration (CI)
on: pull_request
permissions:
contents: read
jobs:
check-whitespace:
name: Check Whitespace
runs-on: ubuntu-24.04
steps:
- name: Checkout code.
uses: actions/checkout@v4
- name: Check whitespace consistency.
uses: docker://ghcr.io/developerc286/consistent_whitespace:0.7.3
with:
args: .check-whitespace:
image: ghcr.io/developerc286/consistent_whitespace:0.7.3
script:
- consistent_whitespace .
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"version="v0.7.3" && wget -O - "https://github.com/DeveloperC286/consistent_whitespace/releases/download/${version}/x86_64-unknown-linux-musl.tar.gz" | tar xz --directory "/usr/bin/"cargo install consistent_whitespace@0.7.3You can use the Docker image published to ghcr.io/developerc286/consistent_whitespace.
docker run --rm -v $(pwd):/workspace -w /workspace ghcr.io/developerc286/consistent_whitespace:0.7.3 .Report issues or request features on our GitHub Issues.