Skip to content

NormalizeTags

Normalize tag names by normalizing case and removing duplicates.

Disabling the formatter

NormalizeTags is included in the default formatters, but it can be also run separately with:

robocop format --select NormalizeTags

You can also disable it:

robocop format --configure NormalizeTags.enabled=False

Supported cases:

  • lowercase (default),
  • uppercase
  • titlecase

You can configure a case using case parameter:

robocop format --select NormalizeTags --configure NormalizeTags.case=uppercase
[tool.robocop.format]
select = [
    "NormalizeTags"
]
configure = [
    "NormalizeTags.case=uppercase"
]

You can remove duplicates without normalizing a case by setting normalize_case parameter to False:

robocop format --select NormalizeTags --configure NormalizeTags.normalize_case=False
[tool.robocop.format]
select = [
    "NormalizeTags"
]
configure = [
    "NormalizeTags.normalize_case=False"
]

Preserve formatting

Tags formatting like new lines, separators or comments position will be lost when using NormalizeTags formatter. You can preserve formatting by using preserve_format flag:

robocop format --select NormalizeTags --configure NormalizeTags.preserve_format=True
[tool.robocop.format]
select = [
    "NormalizeTags"
]
configure = [
    "NormalizeTags.preserve_format=True"
]

The downside is that the duplications will not be removed when preserve_format is enabled.

*** Test Cases ***
Test
    [Tags]    NeedNormalization_Now    # Tell some
    ...    also_need_Normalization     # interesting story
    ...     TAG                        # about those tags
*** Test Cases ***
Test
    [Tags]    neednormalization_now    also_need_normalization    tag    # Tell some    # interesting story    # about those tags
*** Test Cases ***
Test
    [Tags]    neednormalization_now    # Tell some
    ...    also_need_normalization     # interesting story
    ...     tag                        # about those tags