MarketSquare / robotframework-robocop

Tool for static code analysis of Robot Framework language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug] "[W0601] tag-with-space" raises a warning because of variable in tag.

gohierf opened this issue · comments

What happened?

I get a warning W0601 stating that there should not be any space in tags, but the spaces are in the variable name, not in the variable value and resulting tag. Shouldn't variable names be excluded from this constraint? RF7 has no issue with dealing with this "dynamic" tag.

What command/code did you try to run?

Here I am defining two tags (in suite settings) using global variables.

*** Settings ***
Test Tags
...    sut:%{SUT_CONFIG}
...    snmp:${SNMP TEST VERSION}

What is the full error message?

No issue for sut:%{SUT_CONFIG} tag, because there is an underscore.

But the following warning is raised for snmp:${SNMP TEST VERSION} tag:

Tag 'snmp:${SNMP TEST VERSION}' should not contain spacesrobocoptag-with-space-W0601

image

What did you expect to happen instead?

I think the rule should not check space in variables name. I could replace the space with an underscore in my variable name, but then it would not be homogeneous with the rest of my file.

The actual value of ${SNMP TEST VERSION} is 2, so no space in resulting tag. But I assume robocop is not able to check this value.

Operating System

Windows

Robocop version

5.0.3

I agree, all tag rules should ignore variable in tags. Up for discussion if those variable should be checked by variable rules (variable naming etc).

From my "user point of view", it feels more intuitive that the variable rules are checked for variable in tags too.