Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Python Linting in VSCode?

    General Talk
    programming
    2
    3
    1.0k
    Loading More Posts
    • 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.
    • CJtheTigerC
      CJtheTiger
      last edited by

      Hello coders.

      Are you linting your Python code?

      My IDE is Visual Studio Code and I tried PyLint but got immediately shot down when it didn't recognize the values I declared in the .h files but tried to reference them in the python code.
      2af6a64d-6854-41a2-aaa1-9be3da20c68f-image.png
      I can't imagine putting # pylint: disable=no-member anywhere I'm using these just to get around this rule for these values.

      From what I understand I also can't get around this with Stubbs?

      It also seems to simply use wrong metadata for its linting, like when calling c4d.utils.DegToRad it says that the function has no return while it very clearly has:
      df82985c-6668-4589-854f-b7711c9068ed-image.png
      Does not make any sense to me.

      Oh, and on top of that it's super slow to recognize any changes. I'm used to near instant feedback from C# development using Visual Studio. This should be possible for Python as well right?

      Are there any linters or settings you can recommend?

      Best regards,
      Daniel

      1 Reply Last reply Reply Quote 0
      • M
        m_adam
        last edited by m_adam

        Hi @CJtheTiger may I ask how did you setup VsCode? Did you followed Visual Studio Code Integration Manual?

        With that's said it is expected because these symbols are only know at runtime by the Cinema 4D Python VM, but VSCode use a standard python not the one from the Python VM (and it is currently not possible to use it). So if you want to have autocompletion for them for the moment the only way is to have them in a python file as well. You can use the Symbol Parser Manual to automatically generate such a file.

        I personally do not use PyLint neither VsCode as I never get them to work in a reliable manner and they are very resource heavy so I can't really help you here. Maybe @ferdinand could help but he is in the moment in holiday so do not expect an answers before the 11th January.

        Cheers,
        Maxime.

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

        CJtheTigerC 1 Reply Last reply Reply Quote 0
        • CJtheTigerC
          CJtheTiger @m_adam
          last edited by

          Hi @m_adam,

          I coincidentally followed the steps on there when I installed the VS Code extension way back. It's pretty straight forward.

          PyLint in VS Code immediately ramped up my CPU usage so I got rid of that extension. But maybe there's a trick that someone else knows about that could help me out. I'm always open for suggestions and alternatives.

          What IDE are you using if I may ask? Did you setup anything special to make life easier?

          Best regards,
          Daniel

          1 Reply Last reply Reply Quote 0
          • First post
            Last post