-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtests.sh
More file actions
executable file
·41 lines (34 loc) · 822 Bytes
/
tests.sh
File metadata and controls
executable file
·41 lines (34 loc) · 822 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
set -eu
function help()
{
echo ""
echo "fix-lint Fix linting problems"
echo "lint Run the code linters"
echo "mypy Type check the code"
echo ""
exit 1
}
function fix_lint()
{
echo "Formatting with black..."
black --skip-string-normalization -l 79 crap/
echo "Formatting with isort..."
isort --profile black --force-grid-wrap 6 crap/
}
function lint()
{
echo "Checking with black..."
black --check --diff --skip-string-normalization -l 79 crap/
echo "Checking with isort..."
isort --check-only --df --profile black --force-grid-wrap 6 crap/
}
function mypy()
{
command mypy crap/
}
if [ $# -eq 0 ] || [ "$1" == "-h" ] || [ "$1" == "--help" ] || [ "$1" == "help" ] ; then
help
fi
command=${1//-/_}
$command "${@:2}"