File: test_code_quality.sh

package info (click to toggle)
python-recurring-ical-events 3.3.3-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,128 kB
  • sloc: python: 2,896; sh: 15; makefile: 3
file content (23 lines) | stat: -rwxr-xr-x 360 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(' recurring_ical_events.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"