OrderTags

Order tags in case-insensitive way in ascending order.

OrderTags is not included in default transformers, that’s why you need to call it with --transform explicitly:

robotidy --transform OrderTags src

Or configure enabled parameter:

robotidy --configure OrderTags:enabled=True

This relates to tags in Test Cases, Keywords, Force Tags and Default Tags.

*** Settings ***
Documentation       OrderTags acceptance tests
Force Tags      forced_tag_1    forced_tag_aa     forced_tag_2    forced_tag_Ab    forced_tag_Bb    forced_tag_ba
Default Tags    default_tag_1    default_tag_aa    default_tag_2    default_tag_Ab    default_tag_Bb    default_tag_ba

*** Test Cases ***
Tags Upper Lower
    [Tags]    ba    Ab    Bb    Ca    Cb    aa
    My Keyword

*** Keywords ***
My Keyword
    [Tags]    ba    Ab    Bb    Ca    Cb    aa
    No Operation

Using the same example with reverse=True param we will get tags in descending order:

robotidy --transform OrderTags:reverse=True src
*** Test Cases ***
Tags Upper Lower
    [Tags]    ba    Ab    Bb    Ca    Cb    aa
    My Keyword

Tags can be also order in case-sensitive way:

robotidy --transform OrderTags:case_sensitive=True:reverse=False src
*** Test Cases ***
Tags Upper Lower
    [Tags]    ba    Ab    Bb    Ca    Cb    aa
    My Keyword

Force Tags and Default Tags ordering can be disabled like this:

robotidy --transform OrderTags:default_tags=False:force_tags=False src
*** Settings ***
Documentation       OrderTags acceptance tests
Force Tags      forced_tag_1    forced_tag_aa     forced_tag_2    forced_tag_Ab    forced_tag_Bb    forced_tag_ba
Default Tags    default_tag_1    default_tag_aa    default_tag_2    default_tag_Ab    default_tag_Bb    default_tag_ba

*** Test Cases ***
Tags Upper Lower
    [Tags]    ba    Ab    Bb    Ca    Cb    aa
    My Keyword