Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
gohierf opened this issue Sep 4, 2024 · 1 comment
Open

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

gohierf opened this issue Sep 4, 2024 · 1 comment

Comments

@gohierf
Copy link

gohierf commented Sep 4, 2024

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
Copy link
Author

gohierf commented Sep 4, 2024

Side note:
if I run robotidy multiple times on the following code, the line Log To Console ${b} eventually gets transformed.
But not on the two first pass, while ${1_E-09} gets transformed on the first run.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant