From 275f359d57e2bf024188da40fb7aa656d1b392cb Mon Sep 17 00:00:00 2001 From: Jon Michael Aanes Date: Wed, 27 Aug 2025 10:26:08 +0200 Subject: [PATCH] Support brankets --- standardize_test_format/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/standardize_test_format/__init__.py b/standardize_test_format/__init__.py index b310c20..dd468c1 100644 --- a/standardize_test_format/__init__.py +++ b/standardize_test_format/__init__.py @@ -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'))