RenameKeywords¶
Enforce keyword naming. Title Case is applied to the keyword name and underscores are replaced by spaces. It has only basic support for keywords with embedded variables - use it at your own risk.
Enabling the formatter
RenameKeywords is not included in default formatters.
You can enable it by using --select and --extend-select options.
You can keep underscores if you set remove_underscores to False:
Keyword case¶
By default, each word in the keyword case is capitalized. It can be configured using keyword_case parameter:
Case normalization¶
When converting the case, only the affected letter (first in sentence or first of each word) is affect. This is
controled by case_normalization parameter (default "first_letter"):
Use skip_keyword_call to ignore case normalization on selected keyword calls.
Library name¶
By default, the library name in the keyword name is ignored. Anything before the last dot in the name is considered as
a library name. Use ignore_library = True parameter to control if the library name part (Library.Keyword) of keyword call
should be renamed.
Replace pattern¶
It is also possible to configure replace_pattern parameter to find and replace regex pattern. Use replace_to
to set replacement value. This configuration (underscores are used instead of spaces):
replaces all occurrences of name Rename Me (case-insensitive thanks to (?i) flag) to New Shining Name:
This feature makes this formatter a convenient tool for renaming your keywords across a Robot Framework project.