Skip to content

Commit

Permalink
Make python 3.8 compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
badsketch committed Jun 30, 2024
1 parent 90df10b commit 4b4ea5c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pylint/checkers/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,16 @@ def process_tokens(self, tokens: list[tokenize.TokenInfo]) -> None:
elif self.linter.config.check_fixme_in_docstring and self._is_docstring_comment(token_info):
docstring_lines = token_info.string.split("\n")
for line_no, line in enumerate(docstring_lines):
comment_text = line.removeprefix('"""').lstrip().removesuffix('"""') # trim '""""' and whitespace
if self._docstring_fixme_pattern.search('"""' + comment_text.lower()):
if line.startswith('"""'):
line = line[3:]
line = line.lstrip()
if line.endswith('"""'):
line = line[:-3]
if self._docstring_fixme_pattern.search('"""' + line.lower()):
self.add_message(
"fixme",
col_offset=token_info.start[1] + 1,
args=comment_text,
args=line,
line=token_info.start[0] + line_no,
)

Expand Down

0 comments on commit 4b4ea5c

Please sign in to comment.