Search code examples
pylint

How do I disable "TODO" warnings in pylint?


When running pylint on a python file it shows me warnings regarding TODO comments by default. E.g.:

************* Module foo
W:200, 0: TODO(SE): fix this! (fixme)
W:294, 0: TODO(SE): backlog item (fixme)
W:412, 0: TODO(SE): Delete bucket? (fixme)

While I do find this behavior useful, I would like to know of a way of temporarily and/or permanently turn these specific warnings on or off.

I am able to generate a pylint config file: pylint --generate-rcfile > ~/.pylintrc

I'm just note sure what to put in this file to disable warnings for TODO comments.


Solution

  • in the generated config file, you should see a section

      [MISCELLANEOUS]
    
      # List of note tags to take in consideration, separated by a comma.
      notes=FIXME,XXX,TODO
    

    simply drop TODO from the "notes" list.

    The config file is found at

    ~/.pylintrc
    

    If you have not generated the config file, this can be done with

    pylint --generate-rcfile > ~/.pylintrc