Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wwwanlingxiao
public-apis
Commits
ed25ea30
Commit
ed25ea30
authored
Mar 23, 2021
by
Marek Dano
Browse files
Remove duplicate check of links in validate_format.py
parent
a1b7e4c4
Changes
1
Hide whitespace changes
Inline
Side-by-side
build/validate_format.py
View file @
ed25ea30
...
@@ -20,7 +20,6 @@ num_segments = 5
...
@@ -20,7 +20,6 @@ num_segments = 5
errors
=
[]
errors
=
[]
title_links
=
[]
title_links
=
[]
previous_links
=
[]
anchor_re
=
re
.
compile
(
anchor
+
'\s(.+)'
)
anchor_re
=
re
.
compile
(
anchor
+
'\s(.+)'
)
section_title_re
=
re
.
compile
(
'\*\s\[(.*)\]'
)
section_title_re
=
re
.
compile
(
'\*\s\[(.*)\]'
)
link_re
=
re
.
compile
(
'\[(.+)\]\((http.*)\)'
)
link_re
=
re
.
compile
(
'\[(.+)\]\((http.*)\)'
)
...
@@ -68,12 +67,6 @@ def check_entry(line_num, segments):
...
@@ -68,12 +67,6 @@ def check_entry(line_num, segments):
title
=
title_re_match
.
group
(
1
)
title
=
title_re_match
.
group
(
1
)
if
title
.
upper
().
endswith
(
' API'
):
if
title
.
upper
().
endswith
(
' API'
):
add_error
(
line_num
,
'Title should not end with "... API". Every entry is an API here!'
)
add_error
(
line_num
,
'Title should not end with "... API". Every entry is an API here!'
)
# do not allow duplicate links
link
=
title_re_match
.
group
(
2
)
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 Title
# END Title
# START Description
# START Description
# first character should be capitalized
# first character should be capitalized
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment