Bug 339067 - Improper indentation for multi-line if tests in python
Summary: Improper indentation for multi-line if tests in python
Status: CONFIRMED
Alias: None
Product: frameworks-ktexteditor
Classification: Frameworks and Libraries
Component: indentation (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-14 12:38 UTC by Todd
Modified: 2021-10-04 22:01 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Todd 2014-09-14 12:38:48 UTC
Python code does not correctly indent when using parentheses to create multi-line "if" tests.  In order to make it visually clearer, the second line should be indented one extra level (according to the pep8 module).

This is only an issue with "if" tests, because "if (" is 4 characters.  So "for (", "while (", even "elif (" should not be additionally indented.

Ideally, if it is possible, the indenter could check the number of characters of indentation and do this in any case where such a visual ambiguity could occur, but I don't know if this is possible.

Reproducible: Always


Actual Results:  
if (True == 1 or
    False == 0):
    pass

Expected Results:  
if (True == 1 or
        False == 0):
    pass
Comment 1 Buovjaga 2016-06-25 16:32:43 UTC
Repro.

Arch Linux 64-bit
Kate 16.04.2
KDE Frameworks 5.23.0
Qt 5.7
xcb wm