MarketSquare / robotframework-robocop

Tool for static code analysis of Robot Framework language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support specific alignment for run keywords

gohierf opened this issue · comments

Robocop and Robotidy have a different opinion on the alignment of the following code.

SSH Wait For Device To Close SSH
    # robocop: off=misaligned-continuation-row
    [Documentation]    Wait until SSH connection is closed by device.
    Wait Until Keyword Succeeds    2min    2s
    ...    Run Keyword And Expect Error    SSHException: SSH session not active
    ...        SSH Log FW Version    level=DEBUG

Robotidy indents the last line, to better see the keyword inside keyword call. Which I like very much.

But Robocop raises a "misaligned-continuation-row" warning W1015 on this last line.

Would it be possible for robocop rule W1015 to take into account this specific case and not raise a warning?

I was thinking about it for a while. Then I have noticed I have disabled this particular rule in my current project with "disabled because of IndentNestedKeywords transformer" comment which proves your point :). I think it's best to have behaviour of both Robocop and Robotidy as close as possible. If something is configurable (can be enabled/disabled) it should be also possible in other tool.

For this issue I can either skip all run keywords in this rule altoghether (and explain in the documentation) or better, make it configurable (ignore_run_keywords).