Skip to content

DeveloperC286/consistent_whitespace

Repository files navigation

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.

About

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

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors