Skip to content

Commit 2aad460

Browse files
apply yapf styleguide
Signed-off-by: Konrad Weihmann <kweihmann@outlook.com>
1 parent d340dca commit 2aad460

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

comment_parser/parsers/python_parser.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import tokenize
66
from comment_parser.parsers import common
77

8+
89
def extract_comments(code):
910
"""Extracts a list of comments from the given Python script.
1011
@@ -37,9 +38,11 @@ def extract_comments(code):
3738
tokenize.TokenError
3839
"""
3940
triplequotes = ['"""', "'''"]
40-
multicommprevnums = [tokenize.ENCODING, tokenize.NEWLINE, tokenize.NL,
41-
tokenize.INDENT, tokenize.DEDENT]
42-
prevtoknum = None # Stores the previous token's type.
41+
multicommprevnums = [
42+
tokenize.ENCODING, tokenize.NEWLINE, tokenize.NL, tokenize.INDENT,
43+
tokenize.DEDENT
44+
]
45+
prevtoknum = None # Stores the previous token's type.
4346
comments = []
4447
tokens = tokenize.tokenize(io.BytesIO(code.encode()).readline)
4548
for toknum, tokstring, tokloc, _, _ in tokens:

comment_parser/parsers/tests/python_parser_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def testTripleQuoteCommentsDoubleQuoteMultiline(self):
5858
logging.warning(code)
5959
expected = [common.Comment(code.strip('"'), 1, multiline=True)]
6060
self.assertEqual(comments, expected)
61-
61+
6262
def testTripleQuoteCommentsDoubleQuoteSingleline(self):
6363
code = '"""this is triple quote comment"""'
6464
comments = python_parser.extract_comments(code)
@@ -80,7 +80,7 @@ def testTripleQuoteCommentsSingleQuoteMultiline(self):
8080
logging.warning(code)
8181
expected = [common.Comment(code.strip('\''), 1, multiline=True)]
8282
self.assertEqual(comments, expected)
83-
83+
8484
def testTripleQuoteCommentsSingleQuoteSingleline(self):
8585
code = '\'\'\'this is triple quote comment\'\'\''
8686
comments = python_parser.extract_comments(code)

0 commit comments

Comments
 (0)