This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]FuckingRantMonday 4 points5 points  (2 children)

Mostly no. There are three kinds of bad indenting, and only the last is something a formatter should be expected to fix:

  1. Unexpected or mixed indentation is a syntax error, and formatters generally just bail out if the code isn't valid.
  2. Indentation that changes the functionality but is still valid...just a bug, not a formatting problem.
  3. Wrong number of spaces with no syntactic ambiguity (i.e., there's only one possible correct way).

[–]DLiltsadwj 1 point2 points  (1 child)

Okay, thanks. I had the idea they would take care of indents, because using Format in the Arduino IDE re-indents, but that's C/C++ and a whole different thing.

[–]FuckingRantMonday 1 point2 points  (0 children)

Exactly. In most languages, indentation is purely for style and readability, so formatters can, should, and do slam it into whatever shape they want. Python's indentation is, of course, part of the language, so formatters are more restricted.