mirror of
https://github.com/public-apis/public-apis.git
synced 2025-05-13 17:16:47 +02:00
Update test formatting
This commit is contained in:
parent
eb49420728
commit
4639c4ba11
1 changed files with 3 additions and 4 deletions
|
@ -19,7 +19,7 @@ index_link = 5
|
||||||
|
|
||||||
errors = []
|
errors = []
|
||||||
title_links = []
|
title_links = []
|
||||||
anchor_re = re.compile('###\s(.+)')
|
anchor_re = re.compile(anchor + '\s(.+)')
|
||||||
section_title_re = re.compile('\*\s\[(.*)\]')
|
section_title_re = re.compile('\*\s\[(.*)\]')
|
||||||
|
|
||||||
|
|
||||||
|
@ -128,6 +128,7 @@ def check_format(filename):
|
||||||
category_line = line_num
|
category_line = line_num
|
||||||
num_in_category = 0
|
num_in_category = 0
|
||||||
continue
|
continue
|
||||||
|
# skips lines that we do not care about
|
||||||
if not line.startswith('|') or line.startswith('|---'):
|
if not line.startswith('|') or line.startswith('|---'):
|
||||||
continue
|
continue
|
||||||
num_in_category += 1
|
num_in_category += 1
|
||||||
|
@ -144,11 +145,9 @@ def check_format(filename):
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
num_args = len(sys.argv)
|
if len(sys.argv) < 2:
|
||||||
if num_args < 2:
|
|
||||||
print("No file passed (file should contain Markdown table syntax)")
|
print("No file passed (file should contain Markdown table syntax)")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
check_format(sys.argv[1])
|
check_format(sys.argv[1])
|
||||||
if len(errors) > 0:
|
if len(errors) > 0:
|
||||||
for err in errors:
|
for err in errors:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue