question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem with uneven-indent rule

See original GitHub issue

Consider following code snippet:

*** Settings ***
Documentation  Suite doc


*** Keywords ***
My Keyword    # robocop: disable
    [Documentation]  Some doc
    No Operation

It does not report any issues. But if we change line 6th and decrease the number of spaces between the keyword name and the comment (which is a Robocop disabler) by 2, so the line looks like this:

My Keyword  # robocop: disable

then we have this issue reported by Robocop: indent_robocop.robot:7:5 [W] 1007 Line is over-indented (uneven-indent) which should not happen.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
bhirszcommented, Aug 27, 2021

Fixed mentioned issues in linked PR.

@matusaurio I’ve created separate issue for your report - since I think it would be best to solve it by introducing new way of defining block disabler. See here #431

1reaction
bhirszcommented, Aug 27, 2021

Thank you for data. The way it should be designed: both settings and node content (such as template args, keyworc calls) should use different ‘look ups’ for correct indent length. But it looks like it use the same look up. Look up is created by chosing most often used indent in given keyword. So:

Keyword
               Longer indent
               Longer indent
   It will be reported because it uses different indent than most popular one
               Longer indent

That’s why it’s reporting under-indented issue when you remove one space -> because the next two lines are used as “most popular indent” to be compared to.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't increase Indent on even numbered pages...
On my odd numbered pages, indenting works like it should. If I indent, it moves all of the text over, and the 10th...
Read more >
What should I do with "Unexpected indent" in Python?
Here are some steps you can take to correct this: Copy the tabs or spaces that are causing the error.
Read more >
Why doesn't my code work? Indentation Errors - YouTube
In this video, I answer that question with one type of possible error that is common to beginners in Python, indentation errors.
Read more >
indentation - Stylelint
Always indent at-rules, rules, comments, declarations, inside parentheses and multi-line values by 2 spaces. The following patterns are considered problems:.
Read more >
Indentation In Python - Indent Error Fix | Code Part Time
To fix Indent Error in Python, just follow one rule - You must use the same number of spaces throughout the code block;...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found