Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Disable specific Python warnings
Forum Updated to NodeBB v4.3 + New Features

Disable specific Python warnings

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
python
4 Posts 3 Posters 2.1k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • silenthellS Offline
    silenthellS Offline
    silenthell
    wrote on last edited by
    #1

    (QTCreator 4.13.3)

    I have a project with python files full of warnings such as:
    070c1ab2-4d35-48c7-b84b-ed1e55eec80b-image.png
    -E501 line too long
    -E303 too many blank lines
    etc.

    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?

    JonBJ 1 Reply Last reply
    0
    • silenthellS silenthell

      (QTCreator 4.13.3)

      I have a project with python files full of warnings such as:
      070c1ab2-4d35-48c7-b84b-ed1e55eec80b-image.png
      -E501 line too long
      -E303 too many blank lines
      etc.

      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?

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @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....

      1 Reply Last reply
      0
      • silenthellS Offline
        silenthellS Offline
        silenthell
        wrote on last edited by
        #3

        @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.

        1 Reply Last reply
        0
        • T Offline
          T Offline
          tompaynter
          wrote on last edited by
          #4

          The linting is performed by pylsp, documentation for this can be found here:
          https://github.com/python-lsp/python-lsp-server

          There is not a great deal of configuration for this in QtCreator however if you create:
          ~/.config/pycodestyle

          You can add something like this to ignore specific rules:

          [pycodestyle]
          ignore = E226, E722, W504, E501
          

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

          1 Reply Last reply
          4
          • aha_1980A aha_1980 referenced this topic on

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved