]> granicus.if.org Git - python/commitdiff
Merged revisions 68222 via svnmerge from
authorGeorg Brandl <georg@python.org>
Sat, 3 Jan 2009 21:30:40 +0000 (21:30 +0000)
committerGeorg Brandl <georg@python.org>
Sat, 3 Jan 2009 21:30:40 +0000 (21:30 +0000)
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r68222 | georg.brandl | 2009-01-03 22:11:58 +0100 (Sat, 03 Jan 2009) | 2 lines

  Disable the line length checker by default.
........

Doc/Makefile
Doc/tools/rstlint.py

index e41f8732874f6864edf22993f3c647bca11d9c1a..4ef79f4e49819693939f9274af74ac3de6dfb185 100644 (file)
@@ -142,4 +142,4 @@ dist:
        cp build/latex/docs-pdf.tar.bz2 dist/python-$(DISTVERSION)-docs-pdf-letter.tar.bz2
 
 check:
-       $(PYTHON) tools/rstlint.py -i tools -s 2
+       $(PYTHON) tools/rstlint.py -i tools
index b5cde9293f511907ab120a986644b5e1e24ce54c..8fd02a904112a7b4cfbbef14b092ab8227cb127f 100755 (executable)
@@ -91,7 +91,6 @@ def check_suspicious_constructs(fn, lines):
 @checker('.py', '.rst')
 def check_whitespace(fn, lines):
     """Check for whitespace and line length issues."""
-    lasti = 0
     for lno, line in enumerate(lines):
         if '\r' in line:
             yield lno+1, '\\r in line'
@@ -99,7 +98,13 @@ def check_whitespace(fn, lines):
             yield lno+1, 'OMG TABS!!!1'
         if line[:-1].rstrip(' \t') != line[:-1]:
             yield lno+1, 'trailing whitespace'
-        if len(line) > 86:
+
+
+@checker('.rst', severity=0)
+def check_line_length(fn, lines):
+    """Check for line length; this checker is not run by default."""
+    for lno, line in enumerate(lines):
+        if len(line) > 81:
             # don't complain about tables, links and function signatures
             if line.lstrip()[0] not in '+|' and \
                'http://' not in line and \