MarketSquare / robotframework-robocop

Tool for static code analysis of Robot Framework language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug] Incorrect task_section definition for mixed-task-test-settings rule

MrBIN89 opened this issue · comments

What happened?

RobotFramework file that causes an issue with mixed-task-test-settings rule

*** Settings ***
Task Tags    demo


*** Tasks ***
My Task To Demo Robocop Issue
    Log To Console    Robocop complains mixed-task-test-settings, though everything is consistent in this file


*** Keywords ***
My Keyword
    Log To Console    Keyword section after Tasks causes incorrect behaviour

Robocop output

[W] tasks\demo.robot:2:1 (mixed-task-test-settings:0326) Use test-related setting 'Test Tags' if Test Cases section is used

I mean this line indentation should be changed to be triggered after for loop without break
https://github.com/MarketSquare/robotframework-robocop/blame/master/robocop/checkers/naming.py#L880

What command/code did you try to run?

robocop

What is the full error message?

[W] tasks\demo.robot:2:1 (mixed-task-test-settings:0326) Use test-related setting 'Test Tags' if Test Cases section is used

What did you expect to happen instead?

robocop ./tasks/demo.robot

Operating System

No response

Robocop version

5.0.3

Good eye - you found the issue and the reason why it happens. I will add some tests to regression to catch it in the future & fix the issue.