linter_lib: Exclude webhook URLs from long line checks.

Now, URLs starting with `{{ external_api_uri_subdomain }}` are
exempted from the 120 char per line requirement.
This commit is contained in:
Eeshan Garg
2017-06-14 21:29:10 -02:30
committed by Tim Abbott
parent 2344e26b1a
commit bbe7ef6c5e

View File

@@ -63,6 +63,7 @@ def build_custom_checkers(by_lang):
if (max_length is not None and line_length > max_length and
'# type' not in line and 'test' not in fn and 'example' not in fn and
not re.match("\[[ A-Za-z0-9_:,&()-]*\]: http.*", line) and
not re.match("`\{\{ external_api_uri_subdomain \}\}[^`]+`", line) and
"#ignorelongline" not in line and 'migrations' not in fn):
print("Line too long (%s) at %s line %s: %s" % (len(line), fn, i+1, line_newline_stripped))
failed = True
@@ -425,10 +426,7 @@ def build_custom_checkers(by_lang):
"docs/readme-symlink.md",
"README.md",
"zerver/webhooks/helloworld/doc.md",
"zerver/webhooks/solano/doc.md",
"zerver/webhooks/trello/doc.md",
"zerver/webhooks/papertrail/doc.md",
"templates/zerver/help/include/git-webhook-url-with-branches.md",
}
for fn in by_lang['md']:
max_length = None