Qt World Summit: Submit your Presentation

Disable specific Python warnings

  • (QTCreator 4.13.3)

    I have a project with python files full of warnings such as:
    -E501 line too long
    -E303 too many blank lines

    Is there a way to deactivate specific error messages.
    In C++ we can configure the Clang code model options to do this, maybe there is something similar for python in the UI or some configuration file somewhere?

  • @silenthell
    Sadly I do not see any way to do this. Qt Creator editing of Python is still very much a second- (third-)class citizen, despite The Qt Company's claims of making it first-class over the years :( I will watch this thread for any better answer.

    You could/might ask this in the Python section of Qt bug reports, or request it as a feature, I don't know whether you'll get a useful response.

    FWIW, when I did Qt Python I was using PyQt5 (PySide2 too lacking on supported features), and I chose the excellent PyCharm editor/debugger for my IDE. I can quite understand why you would want to use Qt Creator now for an integrated experience, but I think it's sorely lacking in comparison....

  • @JonB I see maybe it'll get better in the future. Yes PyCharm works very well but I'm often developing projects that mix C++ and Python so as you said an integrated experience would be awesome.

  • The linting is performed by pylsp, documentation for this can be found here:

    There is not a great deal of configuration for this in QtCreator however if you create:

    You can add something like this to ignore specific rules:

    ignore = E226, E722, W504, E501

    Also if you are interested in what pylsp is doing you can modify its command line to generate logs:

Log in to reply