File: pre-commit.sh

package info (click to toggle)
discus 0.5.0-5
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 200 kB
  • sloc: python: 448; sh: 13; makefile: 7
file content (22 lines) | stat: -rwxr-xr-x 553 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash

here="$( cd "$( dirname $(realpath "${BASH_SOURCE[0]}") )" >/dev/null 2>&1 && pwd )"
root=$(realpath ${here}/..)

set -xeu

on_error() {
	exit_status=$?
	echo An error occurred
}

trap on_error ERR

export PYTHONPATH=${root}
# 1. runs of discus with all the possible options, to check for regressions
# 2. check the coding style
# 3. run the unittests
parallel -- "parallel ${root}/discus.py -- -h -c -d -s -t -g -m -k -v -r '-p 3'" \
	"${root}/discus.py" \
	"flake8 $(find ${root} -name *.py)" \
	"python3 -m unittest tests.unit_tests -v"