robotframework-tidy icon indicating copy to clipboard operation
robotframework-tidy copied to clipboard

Cannot use "disable for one statement" on test argument lines

Open gohierf opened this issue 5 months ago • 1 comments

Apparently disabler robotidy: off does not work when applied on keyword arguments line. Here I tried to compensate for RenameVariable which misbehaving with the number variable ${1E-09} used as a default value for argument ${b}.

I tried to disable robotidy in different locations, but it always changes the argument default value.

BEFORE

My Keyword  # robotidy: off
    # robotidy: off
    [Arguments]    ${a}=${{1E-09}}    ${b}=${1E-09}    # robotidy: off
    Log To Console     ${a}
    Log To Console         ${b}

AFTER

My Keyword  # robotidy: off
    # robotidy: off
    [Arguments]    ${a}=${{1E-09}}    ${b}=${1_E-09}    # robotidy: off
    Log To Console     ${a}
    Log To Console         ${b}

The only way to fix it is to put the disabler before the test case, like so.

# robotidy: off

My Keyword
    [Arguments]    ${a}=${{1E-09}}    ${b}=${1E-09}
    Log To Console     ${a}
    Log To Console         ${b}

But then it does not seem possible to reactivate robotidy for the inside of the test case

gohierf avatar Sep 04 '24 12:09 gohierf