Skip to content

Commit edc55bc

Browse files
committed
Adding a wrapper around pyflakes to filter out warnings which have been inspected and should be ignored.
- Legacy-Id: 249
1 parent 8b17a99 commit edc55bc

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

test/pyflakes.exclude

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
ietf/settings.py:144: 'from settings_local import *' used; unable to detect undefined names
2+
ietf/tests.py:8: redefinition of unused 'ietf' from line 7
3+
ietf/urls.py:1: 'handler500' imported but unused
4+
ietf/urls.py:1: 'handler404' imported but unused
5+
ietf/ipr/views.py:6: 'new' imported but unused
6+
ietf/contrib/__init__.py:1: 'form_decorator' imported but unused
7+
ietf/utils/__init__.py:1: 'flattenl' imported but unused
8+
ietf/utils/__init__.py:1: 'orl' imported but unused
9+
ietf/utils/__init__.py:2: 'log' imported but unused
10+
ietf/utils/__init__.py:3: 'FKAsOneToOne' imported but unused
11+
ietf/idtracker/templatetags/ietf_filters.py:8: redefinition of unused 'emailutils' from line 6

test/run-pyflakes

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
function filter() {
4+
python -c '
5+
import sys
6+
file = open(sys.argv[1])
7+
excludes = [line.strip() for line in file.readlines()]
8+
for line in sys.stdin:
9+
if not line.strip() in excludes:
10+
sys.stdout.write(line)
11+
' "$@"
12+
}
13+
14+
pyflakes "$@" | filter "${0%/*}/pyflakes.exclude"

0 commit comments

Comments
 (0)