Mercurial > public > mercurial-scm > hg
comparison contrib/check-code.py @ 16590:7f76c97361e0
check-code: catch unnecessary s.strip().split() calls
author | Martin Geisler <mg@aragost.com> |
---|---|
date | Mon, 07 May 2012 10:02:50 +0200 |
parents | c326fe884daa |
children | d046eb97d21e |
comparison
equal
deleted
inserted
replaced
16589:fe9a53726484 | 16590:7f76c97361e0 |
---|---|
197 "always assign an opened file to a variable, and close it afterwards"), | 197 "always assign an opened file to a variable, and close it afterwards"), |
198 (r'[\s\(](open|file)\([^)]*\)\.', | 198 (r'[\s\(](open|file)\([^)]*\)\.', |
199 "always assign an opened file to a variable, and close it afterwards"), | 199 "always assign an opened file to a variable, and close it afterwards"), |
200 (r'(?i)descendent', "the proper spelling is descendAnt"), | 200 (r'(?i)descendent', "the proper spelling is descendAnt"), |
201 (r'\.debug\(\_', "don't mark debug messages for translation"), | 201 (r'\.debug\(\_', "don't mark debug messages for translation"), |
202 (r'\.strip\(\)\.split\(\)', "no need to strip before splitting"), | |
202 ], | 203 ], |
203 # warnings | 204 # warnings |
204 [ | 205 [ |
205 (r'.{81}', "warning: line over 80 characters"), | 206 (r'.{81}', "warning: line over 80 characters"), |
206 (r'^\s*except:$', "warning: naked except clause"), | 207 (r'^\s*except:$', "warning: naked except clause"), |