I am noticing an inconsistency with indentation in Python (default language package). I’m running the latest Sublime Text. Depending on current indentation, one type of automatic indentation does not happen as expected. The only deviation from the defaults with regards to indentation is that I have indent_to_bracket
set to true
.
Here is the indentation inside the brackets that I want, and it is the one that is done automatically when at the base of no indentation yet.
example = {
'test1': 1,
'test2': 2
}
Here, I want the same type of auto indent. But, it indents to the same indentation as the variable.
def indent():
example2 = {
'test1': 1,
'test2': 2
}
First of all, this autoindent causes a pycodestyle
linter error because it violates PEP8:
pycodestyle: error
E122 - continuation line missing indentation or outdented
Second, this autoindent behavior is different than Jupyter and other IDEs.
I understand that there are many concious decisions made about indentation and features in Sublime Text and the Python package. Is the above auto indent behavior by design? If so, where is this controlled in the syntax, and is there a way to override this in settings?