You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
robocop doesn't report unused-variable errors if the variable is set within a IF block. It seems to catch those in other control blocks (eg FOR) OK.
What command/code did you try to run?
*** Test Cases ***TC1${U1} Set Variable UNUSED1
IF True
${U2} Set Variable UNUSED2
END
FOR ${_} IN RANGE 1
${U3} Set Variable UNUSED3
END
What is the full error message?
$ robocop -e missing-doc* foo.robot
/tmp/pyvenv/foo.robot:3:3 [I] 0920 Variable '${U1}' is assigned but not used (unused-variable)
/tmp/pyvenv/foo.robot:8:5 [I] 0920 Variable '${U3}' is assigned but not used (unused-variable)
What did you expect to happen instead?
I expected ${U2} to be reported as an unused variable as well as ${U1} and ${U3}
Operating System
Linux
Robocop version
5.2.0
The text was updated successfully, but these errors were encountered:
It is most likely outcome of the logic where we try to find variables defined only for given scope (we don't always want to check if given variable is used if it's defined in specific place). I will look into it how it can be mitigated
What happened?
robocop doesn't report
unused-variable
errors if the variable is set within aIF
block. It seems to catch those in other control blocks (egFOR
) OK.What command/code did you try to run?
What is the full error message?
What did you expect to happen instead?
I expected
${U2}
to be reported as an unused variable as well as${U1}
and${U3}
Operating System
Linux
Robocop version
5.2.0
The text was updated successfully, but these errors were encountered: