lint: Check for absolute/relative link style in developer docs.

This should help avoid a pretty wide range of link bugs we've had in
the past.
This commit is contained in:
Tim Abbott
2017-11-16 12:44:16 -08:00
parent bf77ad3a6e
commit d9da8f859d

View File

@@ -595,7 +595,16 @@ def build_custom_checkers(by_lang):
]
markdown_rules = markdown_whitespace_rules + prose_style_rules + [
{'pattern': '\[(?P<url>[^\]]+)\]\((?P=url)\)',
'description': 'Linkified markdown URLs should use cleaner <http://example.com> syntax.'}
'description': 'Linkified markdown URLs should use cleaner <http://example.com> syntax.'},
{'pattern': 'https://zulip.readthedocs.io/en/latest/[a-zA-Z0-9]',
'exclude': ['docs/overview/contributing.md', 'docs/overview/readme-symlink.md'],
'include_only': set(['docs']),
'description': "Use relatve links (../foo/bar.html) to other documents in docs/",
},
{'pattern': '\][(][^#h]',
'include_only': set(['README.md', 'CONTRIBUTING.md']),
'description': "Use absolute links from docs served by GitHub",
},
]
help_markdown_rules = markdown_rules + [
{'pattern': '[a-z][.][A-Z]',