[PATCH] check-code: added a check for calls to the builtin cmp function

Renato Cunha renatoc at gmail.com
Sat Aug 7 14:14:46 CDT 2010


# HG changeset patch
# User Renato Cunha <renatoc at gmail.com>
# Date 1281208433 10800
# Node ID 7ee9c0e78f7b280b6fc6b0270d46d68b29f485f9
# Parent  4900e7abd6f26b7833a47c73df125e4f16b7d35e
check-code: added a check for calls to the builtin cmp function

diff --git a/contrib/check-code.py b/contrib/check-code.py
--- a/contrib/check-code.py
+++ b/contrib/check-code.py
@@ -74,6 +74,7 @@
      "tuple parameter unpacking not available in Python 3+"),
     (r'lambda\s*\(.*,.*\)',
      "tuple parameter unpacking not available in Python 3+"),
+    (r'(?<!def)\s+(cmp)\(', "cmp is not available in Python 3+"),
     (r'\breduce\s*\(.*', "reduce is not available in Python 3+"),
     (r'\.has_key\b', "dict.has_key is not available in Python 3+"),
     (r'^\s*\t', "don't use tabs"),


More information about the Mercurial-devel mailing list