krz/nba-scores
A CLI/TUI app for NBA scores.
clone: git clone https://gitbay.org/krz/nba-scores.git
main: .githooks/pre-push · raw
1#!/bin/sh
2set -eu
3
4if ! command -v ruff >/dev/null 2>&1; then
5 echo "pre-push: ruff is not installed or not on PATH" >&2
6 exit 1
7fi
8
9before_status="$(git status --porcelain)"
10
11echo "pre-push: running ruff format"
12ruff format
13
14after_status="$(git status --porcelain)"
15if [ "$before_status" != "$after_status" ]; then
16 echo "pre-push: ruff format changed files; commit the formatting before pushing" >&2
17 exit 1
18fi
19
20echo "pre-push: running ruff check"
21ruff check