Is there a way to modify the parse tree similar to pylint #3516
Unanswered
jesse-sony
asked this question in
Q&A
Replies: 1 comment
-
Pyright doesn't support plugins and doesn't allow this sort of customization. We don't have plans to support anything like this. If you want to support this, you'd need to fork the pyright code and create a private version. An alternative is to use a |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We have a custom import management system for our tools. We've looked at converting it to work with python import hooks instead, but haven't gotten to that. So in our code, an import might look like
importTool.importPackage("packageName")
after which you can use
packageName
just as you would something imported viaimport packageName
Obviously this completely breaks any sort of import resolution using pyright. With pylint, we were able to write a plugin that allowed us to modify the AST and replace these statements with import symbols so that pylint can correctly parse all our imports. I was wondering if there was a way to do something similar in pyright or if some sort of generic parser modification might be considered as a feature.
cheers
jesse c
Beta Was this translation helpful? Give feedback.
All reactions