How do I format a multi-line TODO comment in PyCharm?

Stevoisiak picture Stevoisiak · Feb 6, 2018 · Viewed 11.1k times · Source

I want to add a multi-line TODO comment to my PyCharm project.

# TODO: Multiple errors can be wrapped inside an exception.
#       WfcApiException should do recursive error checking to locate
#       and store an arbitrary number of nested errors.

Unfortunately, PyCharm only recognizes the first line as a TODO comment. Any following lines are viewed as standard Python comments.

Failed attempt at a multi-line TODO statement in PyCharm

What is the correct way to format a multi-line TODO comment in PyCharm?

Answer

payala picture payala · Nov 23, 2018

Pycharm 2018.3 does support multiline todo, yay!

https://youtu.be/5gJ7_3wCfUk?t=65

https://blog.jetbrains.com/pycharm/2018/11/pycharm-2018-3-out-now/

So, using your TODO comment:

# TODO: Multiple errors can be wrapped inside an exception.
#       WfcApiException should do recursive error checking to locate
#       and store an arbitrary number of nested errors.

yields:

enter image description here

Actually, you only need to indent the following lines one character to the right of the TODO so this would be just on the limit from being detected:

enter image description here

And the todo is captured as a single item, of course:

enter image description here