Search code examples
pythonqt-creatorunderline

Getting rid of errors and warnings in a python file in Qt Creator


I am working on a python project in Qt Creator, and for some reason it keeps on underlining sections of my code, giving me flake8 warnings and errors. enter image description here

By following this stack overflow question, I have managed to get rid of the labels coming out of the right side of the screen giving me warnings and errors, but I still find the underlining and warning icons on the line numbers very irratating. Is there a way I can get rid of this completely?

EDIT: I have already ran pip uninstall flake8 and the linting and underlining still persists in qt creator.


Solution

  • As far as I know, Qt Creator does not support globally disabling warnings yet. However, you can try ignoring the Flake8 linter on specific files.

    • Ignoring the entire file

      You can add this line to ignore all warnings in the file.

      # flake8: noqa
      
    • Ignoring the specific lines

      Or you can add this comment at the end of every line that you want to ignore errors on.

      # noqa
      

    References