--- /dev/null
+#!/usr/bin/env bash
+
+# Copy me to .git/hooks/pre-commit
+
+set -e
+
+cleanup() {
+ if [[ "$D" && -e "$D" ]];then
+ rm -rf "$D"
+ fi
+}
+trap cleanup EXIT
+
+D=$(mktemp -d)
+[[ "$D" && -d "$D" ]]
+
+git checkout-index --prefix="$D/" -a
+pushd "$D"
+
+nix-shell --arg lint true --run './test.sh lint'
+
+popd
-#!/bin/sh
+#!/usr/bin/env bash
set -e
if [ "$1" = lint ];then
pylint --reports=n --persistent=n --ignore-imports=y \
- -d fixme,invalid-name,missing-docstring,subprocess-run-check,too-few-public-methods *.py
+ -d fixme,invalid-name,missing-docstring,subprocess-run-check,too-few-public-methods -- *.py
formatting_needs_fixing=$(
find . -name '*.py' -print0 |