-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
[stubgen] Add plugin support by passing a configuration file (#14428) #14436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
[stubgen] Add plugin support by passing a configuration file (#14428) #14436
Conversation
if stubgen_options.mypy_config_file: | ||
|
||
def set_strict_flags() -> None: # not needed yet | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure that this is correct. It would treat strict
differently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, something like this would work (I hope so, at least)!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm afraid I'm not familiar enough to know how to continue. The blurb I linked refers to a strict_flag_assignments
variable that gets populated through some deeper method. Do you think strict flags are something that would be useful when parsing config files in stubgen.py
? (I'm not sure of what strict flags even are, maybe with some extra context I can help implement something more robust)
Otherwise, would you be ok leaving the current implementation as is (it at least matches the existing [already merged] stubtest.py
PR that inspired my PR) and someone more knowledgeable could propose a better handling of strict flags in the future?
Thanks for your quick response!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, if this is hard to do, we can skip it for now :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add a test case similar to
mypy/mypy/test/teststubtest.py
Line 1756 in 9944d5f
def test_config_file(self) -> None: |
Fixes #14428
Similar to #9203, this PR exposes a way for
stubgen
to receive a Mypy configuration file with extra options, which allows it to use custom plugins.