[PATCH 1 of 4] check-code: promote 80+ character line warning to an error

Brodie Rao brodie at sf.io
Sun May 13 06:20:05 CDT 2012


# HG changeset patch
# User Brodie Rao <brodie at sf.io>
# Date 1336907847 -7200
# Node ID 3ebeec8253ad6e4656cfae774cd5686b8bf6daa6
# Parent  d947e1da12597090d71c3d97ec224b7aa5513330
check-code: promote 80+ character line warning to an error

diff --git a/contrib/check-code.py b/contrib/check-code.py
--- a/contrib/check-code.py
+++ b/contrib/check-code.py
@@ -135,7 +135,7 @@ pypats = [
     (r'^\s+\w+=\w+[^,)\n]$', "missing whitespace in assignment"),
     (r'(\s+)try:\n((?:\n|\1\s.*\n)+?)\1except.*?:\n'
      r'((?:\n|\1\s.*\n)+?)\1finally:', 'no try/except/finally in Py2.4'),
-    (r'.{85}', "line too long"),
+    (r'.{81}', "line too long"),
     (r' x+[xo][\'"]\n\s+[\'"]x', 'string join across lines with no space'),
     (r'[^\n]\Z', "no trailing newline"),
     (r'(\S[ \t]+|^[ \t]+)\n', "trailing whitespace"),
@@ -206,7 +206,6 @@ pypats = [
   ],
   # warnings
   [
-    (r'.{81}', "warning: line over 80 characters"),
     (r'^\s*except:$', "warning: naked except clause"),
     (r'ui\.(status|progress|write|note|warn)\([\'\"]x',
      "warning: unwrapped ui message"),
@@ -226,7 +225,7 @@ cpats = [
     (r'^  ', "don't use spaces to indent"),
     (r'\S\t', "don't use tabs except for indent"),
     (r'(\S[ \t]+|^[ \t]+)\n', "trailing whitespace"),
-    (r'.{85}', "line too long"),
+    (r'.{81}', "line too long"),
     (r'(while|if|do|for)\(', "use space after while/if/do/for"),
     (r'return\(', "return is not a function"),
     (r' ;', "no space before ;"),


More information about the Mercurial-devel mailing list