From 2f4a80bf7ba87a8aa11975ac94b5cd78964a296f Mon Sep 17 00:00:00 2001 From: davemachado Date: Sun, 6 May 2018 18:53:12 -0400 Subject: [PATCH] Add check for duplicate links --- build/validate_format.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build/validate_format.py b/build/validate_format.py index e59daa0b..3ec2402a 100755 --- a/build/validate_format.py +++ b/build/validate_format.py @@ -20,6 +20,7 @@ num_segments = 6 errors = [] title_links = [] +previous_links = [] anchor_re = re.compile(anchor + '\s(.+)') section_title_re = re.compile('\*\s\[(.*)\]') @@ -96,6 +97,10 @@ def check_entry(line_num, segments): link = segments[index_link] if not link.startswith('[Go!](http') or not link.endswith(')'): add_error(line_num, 'link syntax should be "[Go!](LINK)"') + if link in previous_links: + add_error(line_num, 'duplicate link - entries should only be included in one section') + else: + previous_links.append(link) # END Link