robotframework-robocop
robotframework-robocop copied to clipboard
[Bug] allow the last comment in a file follow previous indent
What happened?
Robocop reports following as [W] 1007 Line is over-indented (uneven-indent)
, but I think it should be allowed. The issue happens only when comments are placed on the last line of the file.
*** Test Cases ***
Test
[Documentation] doc
Keyword
*** Keywords ***
Keyword
[Documentation] this is doc
No Operation # todo: do something
# g
However, also this should be ok, like it is currently:
*** Test Cases ***
Test
[Documentation] doc
Keyword
*** Keywords ***
Keyword
[Documentation] this is doc
No Operation # todo: do something
# g
# EOF
Operating System
Linux
Robocop version
2.3.0
You're right. over/under indented rules are bit complicated right now - I've actually started some improvements (for #504 - to allow for strict checks). I will take a look if it's something I can also fix/improve.
I have actually fixed it without touching the logic - the problem lied in small (stupid) mistake with wrong range :) There will be the change to the uneven-indent (strict checks instead of "fuzzy" one right now) but it's separate topic for this fix - which will be included in the next release.