mirror of
https://github.com/public-apis/public-apis.git
synced 2025-05-11 08:06:46 +02:00
Add build check for title ending with "API"
every entry in this project is an API, so specifying adds nothing meaningful
This commit is contained in:
parent
367de578e6
commit
8940786d0c
2 changed files with 12 additions and 7 deletions
|
@ -49,7 +49,7 @@ def check_format(filename):
|
|||
|
||||
for category, entries in sections.items():
|
||||
if sorted(entries) != entries:
|
||||
add_error(section_line_num[category], '{} section is not in alphabetical order'.format(category))
|
||||
add_error(section_line_num[category], "{} section is not in alphabetical order".format(category))
|
||||
# END Alphabetical Order
|
||||
|
||||
# START Check Entries
|
||||
|
@ -64,6 +64,11 @@ def check_format(filename):
|
|||
add_error(line_num, "each segment must start and end with exactly 1 space")
|
||||
# END Global
|
||||
segments = [seg.strip() for seg in segments]
|
||||
# START Title
|
||||
title = segments[index_title].upper()
|
||||
if title.endswith(' API'):
|
||||
add_error(line_num, 'Title should not contain "API"')
|
||||
# END Title
|
||||
# START Description
|
||||
# first character should be capitalized
|
||||
char = segments[index_desc][0]
|
||||
|
@ -97,7 +102,7 @@ def check_format(filename):
|
|||
def main():
|
||||
num_args = len(sys.argv)
|
||||
if num_args < 2:
|
||||
print("No .md file passed")
|
||||
print("No file passed (file should contain Markdown table syntax)")
|
||||
sys.exit(1)
|
||||
|
||||
check_format(sys.argv[1])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue