From cba292b4bb63830339e0130d90f53825a4848471 Mon Sep 17 00:00:00 2001 From: Vishnu KS Date: Tue, 3 Nov 2020 08:22:42 +0000 Subject: [PATCH] lint: Ensure that docs don't link directly to code lines. --- tools/linter_lib/custom_check.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/linter_lib/custom_check.py b/tools/linter_lib/custom_check.py index 72ffda4739..cc46a9005b 100644 --- a/tools/linter_lib/custom_check.py +++ b/tools/linter_lib/custom_check.py @@ -673,6 +673,10 @@ markdown_rules = RuleList( 'include_only': {'README.md', 'CONTRIBUTING.md'}, 'description': "Use absolute links from docs served by GitHub", }, + {'pattern': r"\.(py|js)#L\d+", + 'include_only': {'docs/'}, + 'description': "Don't link directly to line numbers", + }, ], max_length=120, length_exclude=markdown_docs_length_exclude,