File: test_code_quality.sh

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

set -e

cd "`dirname \"$0\"`"
cd ..

EXIT=0

if grep -n -H 'print(' x_wr_timezone.py; then
    echo "FAIL: print should not be used in production code."
    EXIT=1
fi

cd test

if grep -n -H -E '^[^#]*(today\(|now\()' *.py; then
    echo "FAIL: now() and today() must not be used in test code."
    EXIT=2
fi

echo "exit $EXIT"
exit "$EXIT"