lint: Allow anchor tags to span up to four lines.

This starts to address 1533.  I still think the </p> tags
should be on their own line lined up with the start tag,
so the linter won't let through the specific example
shown in the ticket.
This commit is contained in:
Steve Howell
2016-08-18 07:17:06 -07:00
committed by Tim Abbott
parent 88a7ea54d2
commit 747744ad61
2 changed files with 33 additions and 2 deletions

View File

@@ -153,13 +153,19 @@ def validate(fn=None, text=None, check_indent=True):
end_line = end_token.line
end_col = end_token.col
if start_tag == 'a':
max_lines = 3
else:
max_lines = 1
problem = None
if (start_tag == 'code') and (end_line == start_line + 1):
problem = 'Code tag is split across two lines.'
if start_tag != end_tag:
problem = 'Mismatched tag.'
elif check_indent and end_line > start_line + 1 and end_col != start_col:
problem = 'Bad indentation.'
elif check_indent and (end_line > start_line + max_lines):
if end_col != start_col:
problem = 'Bad indentation.'
if problem:
raise Exception('''
fn: %s