changeset 18055:e440a2c0d944

check-code: make 'missing whitespace in assignment' more aggressive New warnings: > a.b=ab missing whitespace in assignment (the pattern did not accept '.' on the left hand side) > a=a missing whitespace in assignment (the right hand side pattern never matched a single character) > a=a + 7 missing whitespace in assignment (the pattern only matched one character after the identifier following =)
author Mads Kiilerich <madski@unity3d.com>
date Sun, 09 Dec 2012 23:33:16 +0100
parents b35e3364f94a
children d2e97d86e4db
files contrib/check-code.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/check-code.py	Sun Dec 09 23:33:16 2012 +0100
+++ b/contrib/check-code.py	Sun Dec 09 23:33:16 2012 +0100
@@ -135,7 +135,7 @@
     (r"[^_]_\('[^']+'\s*%", "don't use % inside _()"),
     (r'(\w|\)),\w', "missing whitespace after ,"),
     (r'(\w|\))[+/*\-<>]\w', "missing whitespace in expression"),
-    (r'^\s+\w+=\w+[^,)\n]$', "missing whitespace in assignment"),
+    (r'^\s+(\w|\.)+=\w[^,()\n]*$', "missing whitespace in assignment"),
     (r'(\s+)try:\n((?:\n|\1\s.*\n)+?)\1except.*?:\n'
      r'((?:\n|\1\s.*\n)+?)\1finally:', 'no try/except/finally in Python 2.4'),
     (r'(\s+)try:\n((?:\n|\1\s.*\n)*?)\1\s*yield\b.*?'