consistent_whitespace

Crates.ioconsistent_whitespace
lib.rsconsistent_whitespace
version0.7.3
created_at2022-11-05 17:31:29.850177+00
updated_at2026-01-04 00:27:02.330766+00
descriptionA utility that checks for consistent whitespace across your file(s).
homepage
repositoryhttps://github.com/DeveloperC286/consistent_whitespace
max_upload_size
id705958
size132,160
DeveloperC (DeveloperC286)

documentation

README

Consistent Whitespace

crates.io Conventional Commits License

A utility that checks for consistent whitespace across your file(s).

Usage

Basic Usage

Check the current directory for consistent whitespace:

consistent_whitespace

Check specific files or directories:

consistent_whitespace path/to/file.txt path/to/directory/

Whitespace Preferences

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 either

Examples

GitHub Actions

name: 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: .

GitLab CI

check-whitespace:
  image: ghcr.io/developerc286/consistent_whitespace:0.7.3
  script:
    - consistent_whitespace .
  rules:
    - if: $CI_PIPELINE_SOURCE == "merge_request_event"

Installation

Binary

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

cargo install consistent_whitespace@0.7.3

Docker

You 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 .

Issues/Feature Requests

Report issues or request features on our GitHub Issues.

Commit count: 196

cargo fmt