-3

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.

Ali Awan
  • 180
  • 10
  • 1
    always put code, data and full error message as text (not screenshot, not link) in question (not in comment). – furas Nov 06 '21 at 13:00
  • remove `flake8` and it should remove problem. – furas Nov 06 '21 at 13:01
  • I have ran `pip uninstall flake8` and have successfully uninstalled it, however the linting and irratating underlines still persist. – Ali Awan Nov 06 '21 at 16:46
  • @furas, well in this case a screenshot is the only way to demonstrate the issue I guess. It's not about the code itself but about the highlighting in the IDE. – wovano Nov 06 '21 at 16:58
  • if you use `flake8` then maybe read these warnings and make changes suggested in these warnings. I expect that line `#Change...` suggests one space after `#` so if you use`# Change...` then it should remove warning. And if you don't want to make suggested changes then uninstall `flake8`. Of course IDE may have built-in system for checking syntax and this may need to search option in settings and turn of it. – furas Nov 07 '21 at 10:39
  • As I have said in the previous comment, I have already ran `pip uninstall flake8` and I can no longer access it from the command line, perhaps qt creator has it's own copy of the executable somewhere else? Anyhow, uninstalling `flake8` did not solve anything. Is there any other solutions you could suggest I try? – Ali Awan Nov 07 '21 at 13:25

1 Answers1

1

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

Troll
  • 1,895
  • 3
  • 15
  • 34