MarketSquare / robotframework-robocop

Tool for static code analysis of Robot Framework language
Apache License 2.0
182 stars 39 forks source link

[Bug] 0919 unused-argument warning emitted for argument used as start index of FOR ... IN ENUMERATE loop #1073

Closed Mercury37 closed 5 months ago

Mercury37 commented 5 months ago

What happened?

Minimal example:

*** Keywords ***
Example
    [Arguments]    ${start}    @{list}
    FOR    ${index}    ${value}    IN ENUMERATE    @{list}    start=${start}
        Log Many    ${index}    ${value}
    END

What command/code did you try to run?

robocop tmp.resource

What is the full error message?

D:\tmp.resource:1:1 [W] 0204 Missing documentation in resource file (missing-doc-resource-file)
D:\tmp.resource:2:1 [W] 0201 Missing documentation in 'Example' keyword (missing-doc-keyword)
D:\tmp.resource:3:20 [W] 0919 Keyword argument '${start}' is not used (unused-argument)

What did you expect to happen instead?

unused-argument warning should not appear.

Operating System

Windows 10

Robocop version

5.0.4

gohierf commented 1 month ago

I have a similar issue with Except blocks, on 5.4.0

image

My Keyword
    [Documentation]    Showing argument not used but should not
    [Arguments]    ${expected error}
    TRY
        No Operation
    EXCEPT    ${expected error}
        No Operation
    END