Skip to content

Commit 5b8a36b

Browse files
committed
move local aliases -> SECTION_ALIASES
1 parent e9f388a commit 5b8a36b

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

src/blurb/blurb.py

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,17 @@
6060

6161

6262
LOWEST_POSSIBLE_GH_ISSUE_NUMBER = 32426
63+
SECTION_ALIASES = {
64+
'api': 'C API',
65+
'capi': 'C API',
66+
'builtin': 'Core and Builtins',
67+
'builtins': 'Core and Builtins',
68+
'core': 'Core and Builtins',
69+
'demo': 'Tools/Demos',
70+
'demos': 'Tools/Demos',
71+
'tool': 'Tools/Demos',
72+
'tools': 'Tools/Demos',
73+
}
6374

6475
#
6576
# This template is the canonical list of acceptable section names!
@@ -877,21 +888,7 @@ def _find_smart_matches(section):
877888

878889
# Special cases and aliases
879890
normalized = ''.join(section_words).lower()
880-
881-
# Check special aliases
882-
aliases = {
883-
'api': 'C API',
884-
'capi': 'C API',
885-
'builtin': 'Core and Builtins',
886-
'builtins': 'Core and Builtins',
887-
'core': 'Core and Builtins',
888-
'demo': 'Tools/Demos',
889-
'demos': 'Tools/Demos',
890-
'tool': 'Tools/Demos',
891-
'tools': 'Tools/Demos',
892-
}
893-
894-
for alias, section_name in aliases.items():
891+
for alias, section_name in SECTION_ALIASES.items():
895892
if normalized.startswith(alias):
896893
if section_name not in matches:
897894
matches.append(section_name)

0 commit comments

Comments
 (0)