contrib/check-code.py
changeset 23139 e53f6b72a0e4
parent 23134 22e76e370611
child 23936 30b016ef4bd8
equal deleted inserted replaced
23136:6eab50a34fed 23139:e53f6b72a0e4
   289      "use util.writefile() instead"),
   289      "use util.writefile() instead"),
   290     (r'^[\s\(]*(open(er)?|file)\([^)]*\)',
   290     (r'^[\s\(]*(open(er)?|file)\([^)]*\)',
   291      "always assign an opened file to a variable, and close it afterwards"),
   291      "always assign an opened file to a variable, and close it afterwards"),
   292     (r'[\s\(](open|file)\([^)]*\)\.',
   292     (r'[\s\(](open|file)\([^)]*\)\.',
   293      "always assign an opened file to a variable, and close it afterwards"),
   293      "always assign an opened file to a variable, and close it afterwards"),
   294     (r'(?i)descendent', "the proper spelling is descendAnt"),
   294     (r'(?i)descend[e]nt', "the proper spelling is descendAnt"),
   295     (r'\.debug\(\_', "don't mark debug messages for translation"),
   295     (r'\.debug\(\_', "don't mark debug messages for translation"),
   296     (r'\.strip\(\)\.split\(\)', "no need to strip before splitting"),
   296     (r'\.strip\(\)\.split\(\)', "no need to strip before splitting"),
   297     (r'^\s*except\s*:', "naked except clause", r'#.*re-raises'),
   297     (r'^\s*except\s*:', "naked except clause", r'#.*re-raises'),
   298     (r':\n(    )*( ){1,3}[^ ]', "must indent 4 spaces"),
   298     (r':\n(    )*( ){1,3}[^ ]', "must indent 4 spaces"),
   299     (r'ui\.(status|progress|write|note|warn)\([\'\"]x',
   299     (r'ui\.(status|progress|write|note|warn)\([\'\"]x',