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
1d421d88
Unverified
Commit
1d421d88
authored
Jan 16, 2022
by
Matheus Felipe
Browse files
Add max_description_length constant
parent
d2004154
Changes
1
Hide whitespace changes
Inline
Side-by-side
scripts/validate/format.py
View file @
1d421d88
...
@@ -18,6 +18,7 @@ index_cors = 4
...
@@ -18,6 +18,7 @@ index_cors = 4
num_segments
=
5
num_segments
=
5
min_entries_per_category
=
3
min_entries_per_category
=
3
max_description_length
=
100
anchor_re
=
re
.
compile
(
anchor
+
'\s(.+)'
)
anchor_re
=
re
.
compile
(
anchor
+
'\s(.+)'
)
category_title_in_index_re
=
re
.
compile
(
'\*\s\[(.*)\]'
)
category_title_in_index_re
=
re
.
compile
(
'\*\s\[(.*)\]'
)
...
@@ -114,7 +115,7 @@ def check_description(line_num: int, description: str) -> List[str]:
...
@@ -114,7 +115,7 @@ def check_description(line_num: int, description: str) -> List[str]:
err_msgs
.
append
(
err_msg
)
err_msgs
.
append
(
err_msg
)
desc_length
=
len
(
description
)
desc_length
=
len
(
description
)
if
desc_length
>
100
:
if
desc_length
>
max_description_length
:
err_msg
=
error_message
(
line_num
,
f
'description should not exceed 100 characters (currently
{
desc_length
}
)'
)
err_msg
=
error_message
(
line_num
,
f
'description should not exceed 100 characters (currently
{
desc_length
}
)'
)
err_msgs
.
append
(
err_msg
)
err_msgs
.
append
(
err_msg
)
...
...
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