Support brankets
This commit is contained in:
parent
3df2e410df
commit
275f359d57
|
@ -141,7 +141,8 @@ def to_camel_case(description: str) -> str:
|
||||||
.replace('-', ' ')
|
.replace('-', ' ')
|
||||||
.replace('#', ' ')
|
.replace('#', ' ')
|
||||||
.replace(':', ' ')
|
.replace(':', ' ')
|
||||||
.replace("'", '')
|
.replace('(', '')
|
||||||
|
.replace(')', '')
|
||||||
.strip(' \t.')
|
.strip(' \t.')
|
||||||
)
|
)
|
||||||
words = description.split(' ')
|
words = description.split(' ')
|
||||||
|
@ -186,6 +187,8 @@ def parse_display_name_to_description(text: str | None):
|
||||||
text = text.strip()
|
text = text.strip()
|
||||||
return text
|
return text
|
||||||
|
|
||||||
|
MAX_NAME_LENGTH = 80
|
||||||
|
|
||||||
|
|
||||||
def replace_test_pattern(
|
def replace_test_pattern(
|
||||||
match: re.Match,
|
match: re.Match,
|
||||||
|
@ -215,7 +218,7 @@ def replace_test_pattern(
|
||||||
if config.naming_scheme == NamingScheme.PRESERVE:
|
if config.naming_scheme == NamingScheme.PRESERVE:
|
||||||
pass
|
pass
|
||||||
elif config.naming_scheme == NamingScheme.FROM_DESC:
|
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:
|
elif config.naming_scheme == NamingScheme.HASH_OF_DESC:
|
||||||
h = hashlib.sha256()
|
h = hashlib.sha256()
|
||||||
h.update(description.encode('utf8'))
|
h.update(description.encode('utf8'))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user