boakley / robotframework-lint

Linter for robot framework plain text files
Apache License 2.0
126 stars 48 forks source link

A step's list always starts with an empty cell #29

Open jaloren opened 9 years ago

jaloren commented 9 years ago

When I iterate through a set of test case steps, each step's list starts with an empty cell. Note this empty item precedes the first cell in the actual robotframework table. Expectation would be that first cell contain the first 'real' item in the row.

Example output from rflint when iterating through steps.

(5-5)[u'', u'Log', u'this is a test case.']
(6-6)[u'']
(8-8)[u'', u'@{VALUES}=', u'Create List', u'1', u'2', u'4']
(9-9)[u'', u':FOR', u'${var}', u'IN', u'@{VALUES}']
(10-10)[u'', u'\\', u'Log', u'${var}']

Here is the test case table it was iterating through.

*** Test Cases ***

test case one
    [tags]   logging  bar
    Log   this is a test case.

test case two
    @{VALUES}=  Create List   1   2   4
    :FOR    ${var}  IN  @{VALUES}
    \   Log  ${var}
boakley commented 9 years ago

This is by design. The first cell in a table has the test case or keyword name. The body statements always start in the second cell.

On May 29, 2015, at 5:07 PM, jaloren notifications@github.com wrote:

When I iterate through a set of test case steps, each step's list starts with an empty cell. Note this empty item precedes the first cell in the actual robotframework table. Expectation would be that first cell contain the first 'real' item in the row.

Example output from rflint when iterating through steps.

(5-5)u'', u'Log', u'this is a test case.'u''u'', u'@{VALUES}=', u'Create List', u'1', u'2', u'4'u'', u':FOR', u'${var}', u'IN', u'@{VALUES}'[u'', u'\', u'Log', u'${var}'] Here is the test case table it was iterating through.

* Test Cases *

test case one [tags] logging bar Log this is a test case.

test case two @{VALUES}= Create List 1 2 4 :FOR ${var} IN @{VALUES} \ Log ${var} — Reply to this email directly or view it on GitHub.