Browse Source

Add max_description_length constant

pull/3011/head
Matheus Felipe 2 years ago
parent
commit
1d421d8856
No known key found for this signature in database GPG Key ID: AA785C523274872F
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      scripts/validate/format.py

+ 2
- 1
scripts/validate/format.py View File

@@ -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]:
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)


Loading…
Cancel
Save