mirror of
https://github.com/public-apis/public-apis.git
synced 2025-05-28 16:36:24 +02:00
Add check for duplicate links
This commit is contained in:
parent
466f5e89d2
commit
2f4a80bf7b
1 changed files with 5 additions and 0 deletions
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue