1
0

Support brankets
All checks were successful
Run Python tests (through Pytest) / Test (push) Successful in 25s
Verify Python project can be installed, loaded and have version checked / Test (push) Successful in 22s

This commit is contained in:
Jon Michael Aanes 2025-08-27 10:26:08 +02:00
parent 3df2e410df
commit 275f359d57

View File

@ -141,7 +141,8 @@ def to_camel_case(description: str) -> str:
.replace('-', ' ')
.replace('#', ' ')
.replace(':', ' ')
.replace("'", '')
.replace('(', '')
.replace(')', '')
.strip(' \t.')
)
words = description.split(' ')
@ -186,6 +187,8 @@ def parse_display_name_to_description(text: str | None):
text = text.strip()
return text
MAX_NAME_LENGTH = 80
def replace_test_pattern(
match: re.Match,
@ -215,7 +218,7 @@ def replace_test_pattern(
if config.naming_scheme == NamingScheme.PRESERVE:
pass
elif config.naming_scheme == NamingScheme.FROM_DESC:
name = to_camel_case(description)
name = to_camel_case(description)[:MAX_NAME_LENGTH]
elif config.naming_scheme == NamingScheme.HASH_OF_DESC:
h = hashlib.sha256()
h.update(description.encode('utf8'))