Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] allow the last comment in a file follow previous indent #675

Closed
rikerfi opened this issue Aug 6, 2022 · 2 comments · Fixed by #730
Closed

[Bug] allow the last comment in a file follow previous indent #675

rikerfi opened this issue Aug 6, 2022 · 2 comments · Fixed by #730
Labels
bug Something isn't working

Comments

@rikerfi
Copy link
Contributor

rikerfi commented Aug 6, 2022

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

@rikerfi rikerfi added the bug Something isn't working label Aug 6, 2022
@bhirsz
Copy link
Member

bhirsz commented Aug 7, 2022

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.

@bhirsz
Copy link
Member

bhirsz commented Sep 15, 2022

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.

@bhirsz bhirsz closed this as completed Sep 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants