This repository has been archived on 2024-08-02. You can view files and clone it, but cannot push or open issues or pull requests.
orion/misc/git-hooks/pre-commit

17 lines
339 B
Bash
Executable File

#!/bin/bash
set -eo pipefail
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
CHANGESET=$(git diff --cached --name-only --diff-filter=ACM)
function lint_go_files {
echo "Linting modified Go files..."
( cd "$DIR/../.." && make LINT_ARGS="--new-from-rev=HEAD~ ./..." lint )
}
function main {
lint_go_files
}
main