Mercurial > public > mercurial-scm > hg
comparison contrib/check-code.py @ 28884:75309badb485
check-code: reject import urllib
author | timeless <timeless@mozdev.org> |
---|---|
date | Thu, 07 Apr 2016 00:34:07 +0000 |
parents | 9848a6c77a9b |
children | e05bdc01505f |
comparison
equal
deleted
inserted
replaced
28883:032c4c2f802a | 28884:75309badb485 |
---|---|
314 (r'\s0[0-7]+\b', 'legacy octal syntax; use "0o" prefix instead of "0"'), | 314 (r'\s0[0-7]+\b', 'legacy octal syntax; use "0o" prefix instead of "0"'), |
315 # XXX only catch mutable arguments on the first line of the definition | 315 # XXX only catch mutable arguments on the first line of the definition |
316 (r'def.*[( ]\w+=\{\}', "don't use mutable default arguments"), | 316 (r'def.*[( ]\w+=\{\}', "don't use mutable default arguments"), |
317 (r'\butil\.Abort\b', "directly use error.Abort"), | 317 (r'\butil\.Abort\b', "directly use error.Abort"), |
318 (r'^import Queue', "don't use Queue, use util.queue + util.empty"), | 318 (r'^import Queue', "don't use Queue, use util.queue + util.empty"), |
319 (r'^import cStringIO', "don't use cStringIO.StringIO, use util.stringio"), | |
320 (r'^import urllib', "don't use urllib, use util.urlreq/util.urlerr"), | |
319 ], | 321 ], |
320 # warnings | 322 # warnings |
321 [ | 323 [ |
322 (r'(^| )pp +xxxxqq[ \n][^\n]', "add two newlines after '.. note::'"), | 324 (r'(^| )pp +xxxxqq[ \n][^\n]', "add two newlines after '.. note::'"), |
323 ] | 325 ] |