Python Linting in VSCode?
-
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.
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:
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 -
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. -
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