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
d2004154
Unverified
Commit
d2004154
authored
Jan 16, 2022
by
Matheus Felipe
Browse files
Change min_entries_per_section -> min_entries_per_category
parent
6bab1616
Changes
1
Hide whitespace changes
Inline
Side-by-side
scripts/validate/format.py
View file @
d2004154
...
...
@@ -17,7 +17,7 @@ index_https = 3
index_cors
=
4
num_segments
=
5
min_entries_per_
section
=
3
min_entries_per_
category
=
3
anchor_re
=
re
.
compile
(
anchor
+
'\s(.+)'
)
category_title_in_index_re
=
re
.
compile
(
'\*\s\[(.*)\]'
)
...
...
@@ -195,7 +195,7 @@ def check_file_format(filename: str) -> List[str]:
alphabetical_err_msgs
=
check_alphabetical_order
(
lines
)
err_msgs
.
extend
(
alphabetical_err_msgs
)
num_in_category
=
min_entries_per_
section
+
1
num_in_category
=
min_entries_per_
category
+
1
category
=
''
category_line
=
0
...
...
@@ -216,8 +216,8 @@ def check_file_format(filename: str) -> List[str]:
err_msg
=
error_message
(
line_num
,
'category header is not formatted correctly'
)
err_msgs
.
append
(
err_msg
)
if
num_in_category
<
min_entries_per_
section
:
err_msg
=
error_message
(
category_line
,
f
'
{
category
}
category does not have the minimum
{
min_entries_per_
section
}
entries (only has
{
num_in_category
}
)'
)
if
num_in_category
<
min_entries_per_
category
:
err_msg
=
error_message
(
category_line
,
f
'
{
category
}
category does not have the minimum
{
min_entries_per_
category
}
entries (only has
{
num_in_category
}
)'
)
err_msgs
.
append
(
err_msg
)
category
=
line_content
.
split
(
' '
)[
1
]
...
...
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