]> git.scottworley.com Git - nix-pin-deps/blame - test.sh
README: Explain what this is for
[nix-pin-deps] / test.sh
CommitLineData
ac783e58
SW
1#!/bin/sh
2
3set -e
4
5find . -name build -prune -o -name dist -prune -o -name '*.py' -print0 |
6 xargs -0 mypy --strict --ignore-missing-imports --no-warn-unused-ignores
7
8if [ "$1" = lint ];then
9
10 pylint --reports=n --persistent=n --ignore-imports=y \
11 -d fixme,invalid-name,missing-docstring,subprocess-run-check,too-few-public-methods *.py
12
13 formatting_needs_fixing=$(
14 find . -name '*.py' -print0 |
15 xargs -0 -n1 autopep8 --diff -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
16 )
17 if [[ "$formatting_needs_fixing" ]];then
18 echo "Formatting needs fixing:"
19 echo "$formatting_needs_fixing"
20 exit 1
21 fi
22
23fi