diff options
author | Mateusz Bysiek <1270332+mbdevpl@users.noreply.github.com> | 2017-09-29 18:40:02 +0900 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2017-09-29 11:40:02 +0200 |
commit | ecf69937f8037af4b756de356a356267a3d6727c (patch) | |
tree | b5ff5b36cbe8e8955eac3c216d7ba14d87db3d89 | |
parent | 4643f7dfb45d9f98c7a116d87a6f53ff3262d313 (diff) | |
download | pylint-git-ecf69937f8037af4b756de356a356267a3d6727c.tar.gz |
bad-whitespace checking around dotted type hint (#1430) (#1679)
-rw-r--r-- | pylint/checkers/format.py | 2 | ||||
-rw-r--r-- | pylint/test/unittest_checker_format.py | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/pylint/checkers/format.py b/pylint/checkers/format.py index 691b41bcf..b0c68644c 100644 --- a/pylint/checkers/format.py +++ b/pylint/checkers/format.py @@ -631,6 +631,8 @@ class FormatChecker(BaseTokenChecker): elif token[1] == ',': if not bracket_level: return False + elif token[1] == '.': + continue elif token[0] not in (tokenize.NAME, tokenize.STRING): return False return False diff --git a/pylint/test/unittest_checker_format.py b/pylint/test/unittest_checker_format.py index 7820c561f..22ec07b1f 100644 --- a/pylint/test/unittest_checker_format.py +++ b/pylint/test/unittest_checker_format.py @@ -217,6 +217,7 @@ class TestCheckSpace(CheckerTestCase): with self.assertNoMessages(): self.checker.process_tokens(tokenize_str('foo(foo=bar)\n')) self.checker.process_tokens(tokenize_str('foo(foo: int = bar)\n')) + self.checker.process_tokens(tokenize_str('foo(foo: module.classname = bar)\n')) self.checker.process_tokens(tokenize_str('foo(foo: Dict[int, str] = bar)\n')) self.checker.process_tokens(tokenize_str('foo(foo: \'int\' = bar)\n')) self.checker.process_tokens(tokenize_str('foo(foo: Dict[int, \'str\'] = bar)\n')) |