mirror of
https://github.com/python/cpython.git
synced 2025-09-18 14:40:43 +00:00
Disable the line length checker by default.
This commit is contained in:
parent
7044b11818
commit
3b62c2ff69
2 changed files with 8 additions and 3 deletions
|
@ -142,4 +142,4 @@ dist:
|
||||||
cp build/latex/docs-pdf.tar.bz2 dist/python-$(DISTVERSION)-docs-pdf-letter.tar.bz2
|
cp build/latex/docs-pdf.tar.bz2 dist/python-$(DISTVERSION)-docs-pdf-letter.tar.bz2
|
||||||
|
|
||||||
check:
|
check:
|
||||||
$(PYTHON) tools/rstlint.py -i tools -s 2
|
$(PYTHON) tools/rstlint.py -i tools
|
||||||
|
|
|
@ -91,7 +91,6 @@ def check_suspicious_constructs(fn, lines):
|
||||||
@checker('.py', '.rst')
|
@checker('.py', '.rst')
|
||||||
def check_whitespace(fn, lines):
|
def check_whitespace(fn, lines):
|
||||||
"""Check for whitespace and line length issues."""
|
"""Check for whitespace and line length issues."""
|
||||||
lasti = 0
|
|
||||||
for lno, line in enumerate(lines):
|
for lno, line in enumerate(lines):
|
||||||
if '\r' in line:
|
if '\r' in line:
|
||||||
yield lno+1, '\\r in line'
|
yield lno+1, '\\r in line'
|
||||||
|
@ -99,7 +98,13 @@ def check_whitespace(fn, lines):
|
||||||
yield lno+1, 'OMG TABS!!!1'
|
yield lno+1, 'OMG TABS!!!1'
|
||||||
if line[:-1].rstrip(' \t') != line[:-1]:
|
if line[:-1].rstrip(' \t') != line[:-1]:
|
||||||
yield lno+1, 'trailing whitespace'
|
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
|
# don't complain about tables, links and function signatures
|
||||||
if line.lstrip()[0] not in '+|' and \
|
if line.lstrip()[0] not in '+|' and \
|
||||||
'http://' not in line and \
|
'http://' not in line and \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue