diff options
-rw-r--r-- | CHANGES.txt | 2 | ||||
-rwxr-xr-x | pep8.py | 3 | ||||
-rw-r--r-- | testsuite/E26.py | 7 |
3 files changed, 10 insertions, 2 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index ea141f9..dbf3dd1 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -5,7 +5,7 @@ Changelog 1.x (unreleased) ---------------- -* ... +* Allow sphinx.ext.autodoc syntax for comments. (Issue #110) 1.4 (2012-12-22) @@ -796,7 +796,8 @@ def whitespace_before_inline_comment(logical_line, tokens): if prev_end[0] == start[0] and start[1] < prev_end[1] + 2: yield (prev_end, "E261 at least two spaces before inline comment") - if text.startswith('# ') or not text.startswith('# '): + symbol, sp, comment = text.partition(' ') + if symbol not in ('#', '#:') or comment[:1].isspace(): yield start, "E262 inline comment should start with '# '" elif token_type != tokenize.NL: prev_end = end diff --git a/testsuite/E26.py b/testsuite/E26.py index b4f7af7..984efb5 100644 --- a/testsuite/E26.py +++ b/testsuite/E26.py @@ -4,3 +4,10 @@ pass # an inline comment x = x + 1 #Increment x #: E262 x = x + 1 # Increment x +#: E262 +x = y + 1 #: Increment x +#: Okay +pass # an inline comment +x = x + 1 # Increment x +y = y + 1 #: Increment x +#: |