diff --git a/standardize_test_format/__init__.py b/standardize_test_format/__init__.py index fb5dd69..f3b7e3e 100644 --- a/standardize_test_format/__init__.py +++ b/standardize_test_format/__init__.py @@ -42,6 +42,7 @@ class Config: with_display_name: bool only_for_javadoc: bool only_for_display_name: bool + only_for_todo: bool naming_scheme: NamingScheme @@ -198,6 +199,8 @@ def replace_test_pattern( return match.group(0) if config.only_for_display_name and not displayname: return match.group(0) + if config.only_for_todo and 'todo' not in name.lower(): + return match.group(0) # Formatting description = displayname or javadoc or from_camel_case(name) diff --git a/standardize_test_format/__main__.py b/standardize_test_format/__main__.py index 061ae38..079d925 100644 --- a/standardize_test_format/__main__.py +++ b/standardize_test_format/__main__.py @@ -56,7 +56,12 @@ def argument_parser(): argparser.add_argument( '--only-displayname', action='store_true', - help='Only change test with an existing DisplayName', + help='Only change tests with an existing DisplayName', + ) + argparser.add_argument( + '--only-todo', + action='store_true', + help='Only change tests where the test name contains the word "todo"', ) argparser.add_argument( '--naming', @@ -77,6 +82,7 @@ def main(): with_display_name=args.displayname, only_for_javadoc=args.only_javadoc, only_for_display_name=args.only_displayname, + only_for_todo=args.only_todo, naming_scheme=args.naming, )