Commit Graph
2 Commits
Author SHA1 Message Date
Mikhail Golubev 4ca4d0d396 PY-12932 Fix trailing comment detection when it's the first child element 2015-02-09 21:43:37 +03:00
Mikhail Golubev e5f1141929 PY-12932 New policy for pre-formatting comments in Python code
In addition to existing detection of shebang/double hash/doc comments we
consider the following new cases when trying to insert space after '#'
in Python line comments:

* Comments that already start with whitespace are ignored by
formatter.
* Comments that span several lines (up to the first empty line or
non-whitespace element) are not altered either because they may contain
Python code fragments.
* Trailing comments however can be safely adjusted because even if
they contain any code, there cannot be any indentation inside.
2015-02-09 20:03:12 +03:00