MarketSquare / robotframework-robocop

Tool for static code analysis of Robot Framework language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug] unused-variable when the variable is used in Documentation or Tags

revton opened this issue · comments

What happened?

Robocop returns

[I] 0920 Variable '${VAR_DOCUMENTATION}' is assigned but not used (unused-variable)
[I] 0920 Variable '${VAR_TAG}' is assigned but not used (unused-variable)

when the variables is used in a Documentation or Tags

*** Variables ***
${VAR_DOCUMENTATION}    Documentation value
${VAR_TAG}              Tag value


*** Test Cases ***
Test variable in documentation
    [Documentation]    ${VAR_DOCUMENTATION}
    No Operation

Test variable in tags
    [Documentation]    Documentation in test about variable in tags
    [Tags]    ${VAR_TAG}
    No Operation

The test project is here

What command/code did you try to run?

robocop tests/vars.robot

What is the full error message?

\tests\vars.robot:6:1 [I] 0920 Variable '${VAR_DOCUMENTATION}' is assigned but not used (unused-variable)
\tests\vars.robot:7:1 [I] 0920 Variable '${VAR_TAG}' is assigned but not used (unused-variable)

What did you expect to happen instead?

Robocop should not consider the ${VAR_DOCUMENTATION} and ${VAR_TAG} as unused.

Operating System

No response

Robocop version

5.0.4