#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")/.."

# Lists the tracked and the new, not ignored files that match a pattern.
files() {
  git ls-files --cached --others --exclude-standard -- "$@"
}

gofumpt -w .
files '*.nix' | xargs nixfmt
files '*.rst' | xargs rstfmt
files '*.md' | xargs mdformat
