@@ -126,7 +126,7 @@ def lru_cache(maxsize=128): # noqa as it's a fake implementation.
126
126
'%=' , '^=' , '&=' , '|=' , '==' , '<=' , '>=' , '<<=' , '>>=' , '=' ,
127
127
'and' , 'in' , 'is' , 'or' , '->' ] +
128
128
ASSIGNMENT_EXPRESSION_OP )
129
- WHITESPACE = frozenset (' \t ' )
129
+ WHITESPACE = frozenset (' \t \xa0 ' )
130
130
NEWLINE = frozenset ([tokenize .NL , tokenize .NEWLINE ])
131
131
SKIP_TOKENS = NEWLINE .union ([tokenize .INDENT , tokenize .DEDENT ])
132
132
# ERRORTOKEN is triggered by backticks in Python 3
@@ -1056,21 +1056,24 @@ def whitespace_around_named_parameter_equals(logical_line, tokens):
1056
1056
1057
1057
@register_check
1058
1058
def whitespace_before_comment (logical_line , tokens ):
1059
- r """Separate inline comments by at least two spaces.
1059
+ """Separate inline comments by at least two spaces.
1060
1060
1061
1061
An inline comment is a comment on the same line as a statement.
1062
1062
Inline comments should be separated by at least two spaces from the
1063
1063
statement. They should start with a # and a single space.
1064
1064
1065
- Each line of a block comment starts with a # and a single space
1066
- (unless it is indented text inside the comment) .
1065
+ Each line of a block comment starts with a # and one or multiple
1066
+ spaces as there can be indented text inside the comment.
1067
1067
1068
1068
Okay: x = x + 1 # Increment x
1069
1069
Okay: x = x + 1 # Increment x
1070
- Okay: # Block comment
1070
+ Okay: # Block comments:
1071
+ Okay: # - Block comment list
1072
+ Okay: # \xa0 - Block comment list
1071
1073
E261: x = x + 1 # Increment x
1072
1074
E262: x = x + 1 #Increment x
1073
1075
E262: x = x + 1 # Increment x
1076
+ E262: x = x + 1 # \xa0 Increment x
1074
1077
E265: #Block comment
1075
1078
E266: ### Block comment
1076
1079
"""
0 commit comments