contrib/check-code.py
changeset 36949 35d814fe2f30
parent 36164 c38e9248f531
child 36957 a8d540d2628c
equal deleted inserted replaced
36948:0585337ea787 36949:35d814fe2f30
   317      "use opener.write() instead"),
   317      "use opener.write() instead"),
   318     (r'[\s\(](open|file)\([^)]*\)\.read\(',
   318     (r'[\s\(](open|file)\([^)]*\)\.read\(',
   319      "use util.readfile() instead"),
   319      "use util.readfile() instead"),
   320     (r'[\s\(](open|file)\([^)]*\)\.write\(',
   320     (r'[\s\(](open|file)\([^)]*\)\.write\(',
   321      "use util.writefile() instead"),
   321      "use util.writefile() instead"),
   322     (r'^[\s\(]*(open(er)?|file)\([^)]*\)',
   322     (r'^[\s\(]*(open(er)?|file)\([^)]*\)(?!\.close\(\))',
   323      "always assign an opened file to a variable, and close it afterwards"),
   323      "always assign an opened file to a variable, and close it afterwards"),
   324     (r'[\s\(](open|file)\([^)]*\)\.',
   324     (r'[\s\(](open|file)\([^)]*\)\.(?!close\(\))',
   325      "always assign an opened file to a variable, and close it afterwards"),
   325      "always assign an opened file to a variable, and close it afterwards"),
   326     (r'(?i)descend[e]nt', "the proper spelling is descendAnt"),
   326     (r'(?i)descend[e]nt', "the proper spelling is descendAnt"),
   327     (r'\.debug\(\_', "don't mark debug messages for translation"),
   327     (r'\.debug\(\_', "don't mark debug messages for translation"),
   328     (r'\.strip\(\)\.split\(\)', "no need to strip before splitting"),
   328     (r'\.strip\(\)\.split\(\)', "no need to strip before splitting"),
   329     (r'^\s*except\s*:', "naked except clause", r'#.*re-raises'),
   329     (r'^\s*except\s*:', "naked except clause", r'#.*re-raises'),