mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-06-14 13:28:11 +00:00
make tox env for code-checks
This executes: check-debugging, check-interfaces, check-miscaptures, find-trailing-spaces, check-umids, pyflakes. Other changes: * fix check-umids.py to take starting points. run it as `check-umids.py src` instead of `check-umids.py src/allmydata/*.py` * check-debugging: rewrite in python to run from tox: tox doesn't like to run shell scripts. * put check-interfaces.py last: it produces lots of warnings, but passes anyways. The others only produce significant output if they fail.
This commit is contained in:
22
misc/coding_tools/check-debugging.py
Executable file
22
misc/coding_tools/check-debugging.py
Executable file
@ -0,0 +1,22 @@
|
||||
#! /usr/bin/python
|
||||
|
||||
# ./check-debugging.py src
|
||||
|
||||
import sys, re, os
|
||||
|
||||
ok = True
|
||||
umids = {}
|
||||
|
||||
for starting_point in sys.argv[1:]:
|
||||
for root, dirs, files in os.walk(starting_point):
|
||||
for fn in [f for f in files if f.endswith(".py")]:
|
||||
fn = os.path.join(root, fn)
|
||||
for lineno,line in enumerate(open(fn, "r").readlines()):
|
||||
lineno = lineno+1
|
||||
mo = re.search(r"\.setDebugging\(True\)", line)
|
||||
if mo:
|
||||
print "Do not use defer.setDebugging(True) in production"
|
||||
print "First used here: %s:%d" % (fn, lineno)
|
||||
sys.exit(1)
|
||||
print "No cases of defer.setDebugging(True) were found, good!"
|
||||
sys.exit(0)
|
Reference in New Issue
Block a user