ReplaceReturnsΒΆ

Replace return statements (such as [Return] setting or Return From Keyword keyword) with new RETURN statement.

Note

Required Robot Framework version: >=5.0

ReplaceReturns is included in the default transformers but it can be also run separately with:

robotidy --transform ReplaceReturns src

This transformer replace [Return] statement with RETURN:

*** Keywords ***
Keyword
    Sub Keyword
    [Return]    ${value}

It also does replace Return From Keyword and Return From Keyword If:

*** Keywords ***
Keyword
    Return From Keyword If    $condition    ${value}
    Sub Keyword
    Return From Keyword    ${other_value}

Supports global formatting params: --startline and --endline.