#!/bin/bash

set -e

if [[ -n "${CI}" ]]; then
    set -x
fi

function usage() {
    echo -n \
        "Usage: $(basename "$0")
Execute project linters.
"
}

if [ "${BASH_SOURCE[0]}" = "${0}" ]; then
    if [ "${1:-}" = "--help" ]; then
        usage
    else
        pre-commit run codespell --all-files
        pre-commit run doc8 --all-files
        pre-commit run ruff --all-files
        pre-commit run mypy --all-files
    fi
fi
