File: pyflakes

package info (click to toggle)
calendarserver 3.2%2Bdfsg-4%2Bdeb7u3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 16,204 kB
  • sloc: python: 119,181; xml: 4,565; sh: 1,742; sql: 1,493; ansic: 332; makefile: 7
file content (31 lines) | stat: -rwxr-xr-x 1,002 bytes parent folder | download
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
#!/bin/sh

set -e
set -u

wd="$(cd "$(dirname "$0")" && pwd)";
flakes="$(cd "${wd}/../pyflakes-0.4.0" && pwd)";

export PYTHONPATH="${flakes}:${PYTHONPATH:-}";

if [ $# -eq 0 ]; then
  set - calendarserver twext twisted twistedcaldav txdav contrib;
fi;

tmp="$(mktemp "/tmp/pyflakes.XXXXX")";

cd "${wd}" && "${flakes}/bin/pyflakes" "$@" | sed                     \
  -e "/undefined name '_'/d"                                          \
  -e "/undefined name 'CalDAVFile'/d"                                 \
  -e "/redefinition of unused/d"                                      \
  -e "/'from .* import \\*' used; unable to detect undefined names/d" \
  -e "/redefinition of function/d"                                    \
  -e "/i[a-z]*store.py:[0-9][0-9]*: '.*' imported but unused/d"       \
  -e "/xmlext.py:[0-9][0-9]*: /d"                                     \
  | tee "${tmp}";

if [ -s "${tmp}" ]; then error="true"; else error="false"; fi;

rm -f "${tmp}";

if "${error}"; then exit 1; fi;