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.

Regression in indentation of multiline conditions

See original GitHub issue

I noticed that with latest master the following code block

    # do basic argument checks
    if [ "$A" == "true" ] || [ "$A" == "false" ] || [ "$A" == "noconflicts" ] || \
        [ "$B" == "true" ] || [ "$B" == "false" ] || [ "$B" == "noconflicts" ] || \
        [ "$C" == "true" ] || [ "$C" == "false" ]; then
        printerr "Internal error: invalid function call argument"
        exit 2
    fi

is now indented as:

    # do basic argument checks
    if [ "$A" == "true" ] || [ "$A" == "false" ] || [ "$A" == "noconflicts" ] || \
        [ "$B" == "true" ] || [ "$B" == "false" ] || [ "$B" == "noconflicts" ] || \
    [ "$C" == "true" ] || [ "$C" == "false" ]; then
        printerr "Internal error: invalid function call argument"
        exit 2
    fi

3rd line has wrong indentation. I think this is perhaps a regression introduced with one of my latest patches, so I’m opening this to avoid forgetting.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
f18mcommented, Jan 24, 2019

Yes I conform it’s fixed. Now the block of code where the regression happened Is also in the unit tests 😃

0reactions
lovesegfaultcommented, Jan 24, 2019

So, can you confirm that this was fixed by #43?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Code-style for indention of multi-line 'if' statement? [duplicate]
Closed 9 years ago. When indenting long if conditions, you usually do something like this (actually, PyDev indents like that): if ...
Read more >
Incorrect indenting of ternary with multi-line function calls ...
updated: Part 1a: Regression Tell us about your environment ESLint Version: v7.19.0 Node Version: v14.15.4 npm Version: 6.14.10 What parser ...
Read more >
Use conditional statements to handle multi-line conditions
Sometimes I break long conditions in ifs onto several lines. ... However, it is the natural way using correct Python indentation of 4...
Read more >
Multi-line rendering incorrectly on .gitlab-ci.yaml in "View File ...
Properly indent multi-line files when in "view" mode. Relevant logs and/or screenshots. image. Output of checks. Results of GitLab environment ...
Read more >
9.1. Conditional Statements
A conditional statement is a multi-line statement that allows Python to choose among different ... which is a single line followed by an...
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