ReplaceBreakContinueΒΆ

Replace Continue For Loop and Exit For Loop keyword variants with CONTINUE and BREAK statements.

Note

Required Robot Framework version: >=5.0

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

robotidy --transform ReplaceBreakContinue src

It will replace Continue For Loop and Exit For Loop keywords with CONTINUE and BREAK respectively:

*** Test Cases ***
Test
    WHILE    $flag
        Continue For Loop
    END
    FOR    ${var}    IN    abc
        Exit For Loop
    END

Conditional variants are also handled. Shorter IFs can be also formatted to inline IF with InlineIf transformer:

*** Test Cases ***
Test
    WHILE    $flag
        Continue For Loop If    $condition
    END
    FOR    ${var}    IN    abc
        Exit For Loop If    $condition
    END

Continue For Loop and Exit For Loop along with conditional variants outside of the loop are ignored.

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