#!/usr/bin/env bash # lint-all -- run all prose linters on a file and summarize set -euo pipefail file="${1:?Usage: lint-all }" total=0 run_linter() { local name="$1" cmd="$2" echo "========== $name ==========" local output output=$(eval "$cmd" 2>/dev/null) || true if [ -n "$output" ]; then echo "$output" local count count=$(echo "$output" | wc -l) total=$((total + count)) else echo "(clean)" fi echo "" } if command -v vale &>/dev/null; then run_linter "VALE" "vale '$file'" fi if command -v proselint &>/dev/null; then run_linter "PROSELINT" "proselint '$file'" fi if command -v write-good &>/dev/null; then run_linter "WRITE-GOOD" "write-good '$file'" fi if command -v alex &>/dev/null; then run_linter "ALEX" "alex '$file'" fi if command -v diction &>/dev/null; then run_linter "DICTION" "diction -s '$file'" fi if command -v harper &>/dev/null; then run_linter "HARPER" "harper lint '$file'" fi echo "========== SUMMARY ==========" echo "Total issues: ~$total"