Skip to content

SmartSortKeywords

Sort keywords in *** Keywords *** section.

Enabling the formatter

SmartSortKeywords is not included in default formatters.

You can enable it by using --select and --extend-select options.

robocop format --select SmartSortKeywords
robocop format --extend-select SmartSortKeywords

By default sorting is case insensitive, but keywords with leading underscore go to the bottom. Other underscores are treated as spaces. Empty lines (or lack of them) between keywords are preserved.

*** Keywords ***
_my secrete keyword
    Kw2

My Keyword
    Kw1


my_another_cool_keyword
my another keyword
    Kw3
*** Keywords ***
my_another_cool_keyword

my another keyword
    Kw3


My Keyword
    Kw1
_my secrete keyword
    Kw2

Default behaviour could be changed using the following parameters: case_insensitive, ignore_leading_underscore and ignore_other_underscore.