-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support fixme's in docstrings (#9744)
- Loading branch information
Showing
8 changed files
with
170 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
The `fixme` check can now search through docstrings as well as comments, by using | ||
``check-fixme-in-docstring = true`` in the ``[tool.pylint.miscellaneous]`` section. | ||
|
||
Closes #9255 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
fixme:5:1:None:None::"FIXME: beep":UNDEFINED | ||
fixme:11:20:None:None::"FIXME: Valid test":UNDEFINED | ||
fixme:14:5:None:None::"TODO: Do something with the variables":UNDEFINED | ||
fixme:16:18:None:None::"XXX: Fix this later":UNDEFINED | ||
fixme:18:5:None:None::"FIXME: no space after hash":UNDEFINED | ||
fixme:20:5:None:None::"todo: no space after hash":UNDEFINED | ||
fixme:23:2:None:None::"FIXME: this is broken":UNDEFINED | ||
fixme:25:5:None:None::"./TODO: find with notes":UNDEFINED | ||
fixme:27:5:None:None::"TO make something DO: find with regex":UNDEFINED | ||
fixme:7:5:None:None::"TODO: don't forget indented ones should trigger":UNDEFINED | ||
fixme:9:1:None:None::"TODO: that precedes another TODO: is treated as one and the message starts after the first":UNDEFINED | ||
fixme:11:1:None:None::"TODO: large indentations after hash are okay":UNDEFINED | ||
fixme:18:20:None:None::"FIXME: Valid test":UNDEFINED | ||
fixme:21:5:None:None::"TODO: Do something with the variables":UNDEFINED | ||
fixme:23:18:None:None::"XXX: Fix this later":UNDEFINED | ||
fixme:25:5:None:None::"FIXME: no space after hash":UNDEFINED | ||
fixme:27:5:None:None::"todo: no space after hash":UNDEFINED | ||
fixme:30:2:None:None::"FIXME: this is broken":UNDEFINED | ||
fixme:32:5:None:None::"./TODO: find with notes":UNDEFINED | ||
fixme:34:5:None:None::"TO make something DO: find with regex":UNDEFINED |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
"""Tests for fixme in docstrings""" | ||
# pylint: disable=missing-function-docstring, pointless-string-statement | ||
|
||
# +1: [fixme] | ||
"""TODO resolve this""" | ||
# +1: [fixme] | ||
""" TODO: indentations are permitted """ | ||
# +1: [fixme] | ||
''' TODO: indentations are permitted ''' | ||
# +1: [fixme] | ||
""" TODO: indentations are permitted""" | ||
|
||
""" preceding text TODO: is not permitted""" | ||
|
||
""" | ||
FIXME don't forget this # [fixme] | ||
XXX also remember this # [fixme] | ||
FIXME: and this line, but treat it as one FIXME TODO # [fixme] | ||
text cannot precede the TODO: it must be at the start | ||
XXX indentations are okay # [fixme] | ||
??? the codetag must be recognized | ||
""" | ||
|
||
# +1: [fixme] | ||
# FIXME should still work | ||
|
||
# +1: [fixme] | ||
# TODO """ should work | ||
|
||
# """ TODO will not work | ||
"""# TODO will not work""" | ||
|
||
"""TODOist API should not result in a message""" | ||
|
||
# +2: [fixme] | ||
""" | ||
TO make something DO: look a regex | ||
""" | ||
|
||
# pylint: disable-next=fixme | ||
"""TODO won't work anymore""" | ||
|
||
# +2: [fixme] | ||
def function(): | ||
"""./TODO implement this""" | ||
|
||
|
||
''' | ||
XXX single quotes should be no different # [fixme] | ||
''' | ||
def function2(): | ||
''' | ||
./TODO implement this # [fixme] | ||
FIXME and this # [fixme] | ||
''' | ||
'''FIXME one more for good measure''' # [fixme] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[MISCELLANEOUS] | ||
# List of note tags to take in consideration, separated by a comma. | ||
notes=XXX,TODO,./TODO | ||
# Regular expression of note tags to take in consideration. | ||
notes-rgx=FIXME(?!.*ISSUE-\d+)|TO.*DO | ||
# enable checking for fixme's in docstrings | ||
check-fixme-in-docstring=yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
fixme:5:1:None:None::TODO resolve this:UNDEFINED | ||
fixme:7:1:None:None::"TODO: indentations are permitted ":UNDEFINED | ||
fixme:9:1:None:None::"TODO: indentations are permitted ":UNDEFINED | ||
fixme:11:1:None:None::"TODO: indentations are permitted":UNDEFINED | ||
fixme:16:1:None:None::FIXME don't forget this # [fixme]:UNDEFINED | ||
fixme:17:1:None:None::XXX also remember this # [fixme]:UNDEFINED | ||
fixme:18:1:None:None::"FIXME: and this line, but treat it as one FIXME TODO # [fixme]":UNDEFINED | ||
fixme:20:1:None:None::XXX indentations are okay # [fixme]:UNDEFINED | ||
fixme:25:1:None:None::FIXME should still work:UNDEFINED | ||
fixme:28:1:None:None::"TODO """""" should work":UNDEFINED | ||
fixme:37:1:None:None::"TO make something DO: look a regex":UNDEFINED | ||
fixme:45:5:None:None::./TODO implement this:UNDEFINED | ||
fixme:49:1:None:None::XXX single quotes should be no different # [fixme]:UNDEFINED | ||
fixme:53:5:None:None::./TODO implement this # [fixme]:UNDEFINED | ||
fixme:54:5:None:None::FIXME and this # [fixme]:UNDEFINED | ||
fixme:56:5:None:None::FIXME one more for good measure:UNDEFINED |