check-code: report suspicious string joins
This detects patterns of the form:
ui.write("this is missing"
"a space at the join\n")
--- a/contrib/check-code.py Mon Oct 17 19:10:28 2011 -0200
+++ b/contrib/check-code.py Mon Oct 17 17:27:33 2011 -0500
@@ -126,6 +126,7 @@
(r'(?m)(\s+)try:\n((?:\n|\1\s.*\n)+?)\1except.*?:\n'
r'((?:\n|\1\s.*\n)+?)\1finally:', 'no try/except/finally in Py2.4'),
(r'.{85}', "line too long"),
+ (r'(?m) x+[xo][\'"]\n\s+[\'"]x', 'string join across lines with no space'),
(r'[^\n]\Z', "no trailing newline"),
(r'(\S[ \t]+|^[ \t]+)\n', "trailing whitespace"),
# (r'^\s+[^_ \n][^_. \n]+_[^_\n]+\s*=', "don't use underbars in identifiers"),