Files
openide/python/testData/formatter/trailingComment.py
T
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

3 lines
165 B
Python

# Whole-line commend that starts with whitespace.
if True: #Trailing comment with no whitespace
print 'Spam' # Trailing comment with excess whitespace