nil/dev/pre-push.sh
oxalica 9e4cccb088
Some checks failed
CI / Flake package (push) Has been cancelled
CI / Legacy package (push) Has been cancelled
CI / Code style check (push) Has been cancelled
CI / Test (push) Has been cancelled
Check and fix typos
2025-06-13 02:30:50 -04:00

20 lines
503 B
Bash
Executable file

#!/usr/bin/env bash
set -eu
# Requires: [ git nixfmt-rfc-style fd typos ], rust toolchain, npm toolchain
die() { echo "$*" >&2; exit 1; }
if git_dir="$(git rev-parse --show-toplevel)"; then
cd "$git_dir"
fi
typos || die "typos"
cargo fmt --all --check \
|| die 'cargo fmt failed'
fd -e nix --exclude=crates/syntax/test_data --exec-batch nixfmt --check \
|| die 'nixfmt failed'
cargo clippy --workspace --all-targets -- -Dwarnings \
|| die 'clippy failed'
cd editors/coc-nil && npm run lint