Patchwork [3,of,7] check-code: reject import urllib

login
register
mail settings
Submitter timeless@mozdev.org
Date April 11, 2016, 10:48 p.m.
Message ID <112ca3e0b4f25cf0d350.1460414937@waste.org>
Download mbox | patch
Permalink /patch/14532/
State Accepted
Headers show

Comments

timeless@mozdev.org - April 11, 2016, 10:48 p.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1459989247 0
#      Thu Apr 07 00:34:07 2016 +0000
# Node ID 112ca3e0b4f25cf0d3503b93e94e8dba887923c9
# Parent  c9d401b42c8777746d7a22346bd10e5c09915696
check-code: reject import urllib

Patch

diff --git a/contrib/check-code.py b/contrib/check-code.py
--- a/contrib/check-code.py
+++ b/contrib/check-code.py
@@ -316,6 +316,8 @@ 
     (r'def.*[( ]\w+=\{\}', "don't use mutable default arguments"),
     (r'\butil\.Abort\b', "directly use error.Abort"),
     (r'^import Queue', "don't use Queue, use util.queue + util.empty"),
+    (r'^import cStringIO', "don't use cStringIO.StringIO, use util.stringio"),
+    (r'^import urllib', "don't use urllib, use util.urlreq/util.urlerr"),
   ],
   # warnings
   [