summaryrefslogtreecommitdiff
path: root/pylint/utils
diff options
context:
space:
mode:
authorPierre Sassoulas <pierre.sassoulas@gmail.com>2021-11-04 10:08:07 +0100
committerGitHub <noreply@github.com>2021-11-04 10:08:07 +0100
commit65b552a7ce6734dc7bfe53a14342853750cc92a1 (patch)
tree40b35ab6eceb8998d4bb1a8a3713ada24bf27df9 /pylint/utils
parentc532a171fadc9dc06bd97c58d490436456837031 (diff)
downloadpylint-git-65b552a7ce6734dc7bfe53a14342853750cc92a1.tar.gz
Remove unwanted non-breaking whitespaces in comment (#5256)
Diffstat (limited to 'pylint/utils')
-rw-r--r--pylint/utils/pragma_parser.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/pylint/utils/pragma_parser.py b/pylint/utils/pragma_parser.py
index f1c1c2224..549519cf7 100644
--- a/pylint/utils/pragma_parser.py
+++ b/pylint/utils/pragma_parser.py
@@ -9,12 +9,12 @@ from typing import Generator, List, Optional
# so that an option can be continued with the reasons
# why it is active or disabled.
OPTION_RGX = r"""
- \s* # Any number of whithespace
- \#? # One or zero hash
- .* # Anything (as much as possible)
+ \s* # Any number of whithespace
+ \#? # One or zero hash
+ .* # Anything (as much as possible)
(\s* # Beginning of first matched group and any number of whitespaces
- \# # Beginning of comment
- .*? # Anything (as little as possible)
+ \# # Beginning of comment
+ .*? # Anything (as little as possible)
\bpylint: # pylint word and column
\s* # Any number of whitespaces
([^;#\n]+)) # Anything except semicolon or hash or newline (it is the second matched group)
@@ -31,9 +31,9 @@ MESSAGE_KEYWORDS = frozenset(
("disable-next", "disable-msg", "enable-msg", "disable", "enable")
)
# sorted is necessary because sets are unordered collections and ALL_KEYWORDS
-#  string should not vary between executions
-#  reverse is necessary in order to have the longest keywords first, so that, for example,
-# 'disable' string should not be matched instead of 'disable-all'
+# string should not vary between executions
+# reverse is necessary in order to have the longest keywords first, so that, for example,
+# 'disable' string should not be matched instead of 'disable-all'
ALL_KEYWORDS = "|".join(
sorted(ATOMIC_KEYWORDS | MESSAGE_KEYWORDS, key=len, reverse=True)
)
@@ -41,8 +41,8 @@ ALL_KEYWORDS = "|".join(
TOKEN_SPECIFICATION = [
("KEYWORD", fr"\b({ALL_KEYWORDS:s})\b"),
- ("MESSAGE_STRING", r"[0-9A-Za-z\-\_]{2,}"), #  Identifiers
- ("ASSIGN", r"="), #  Assignment operator
+ ("MESSAGE_STRING", r"[0-9A-Za-z\-\_]{2,}"), # Identifiers
+ ("ASSIGN", r"="), # Assignment operator
("MESSAGE_NUMBER", r"[CREIWF]{1}\d*"),
]
@@ -105,7 +105,7 @@ def parse_pragma(pylint_pragma: str) -> Generator[PragmaRepresenter, None, None]
"The keyword doesn't support assignment", action
)
if previous_token:
- #  Something found previously but not a known keyword
+ # Something found previously but not a known keyword
raise UnRecognizedOptionError(
"The keyword is unknown", previous_token
)