diff --git a/Makefile b/Makefile index cbaa7938a..4df6c8ef1 100644 --- a/Makefile +++ b/Makefile @@ -66,7 +66,12 @@ smoketest: .PHONY: code-checks #code-checks: build version-and-path check-interfaces check-miscaptures -find-trailing-spaces -check-umids pyflakes -code-checks: check-miscaptures -find-trailing-spaces -check-umids pyflakes +code-checks: check-debugging check-miscaptures -find-trailing-spaces -check-umids pyflakes + +.PHONY: check-debugging +check-debugging: + misc/coding_tools/check-debugging.sh + @echo .PHONY: check-miscaptures check-miscaptures: diff --git a/misc/coding_tools/check-debugging.sh b/misc/coding_tools/check-debugging.sh new file mode 100755 index 000000000..bfc0ca930 --- /dev/null +++ b/misc/coding_tools/check-debugging.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +OUTPUT=$(grep -R '\.setDebugging(True)' src/allmydata) + +if [[ -n $OUTPUT ]] ; then + echo "Do not use defer.setDebugging(True) in production:" + echo $OUTPUT + exit 1 +fi