Automatically Detect Argument Defaults in attrs-Equivalent Decorators
Description
Fixes #12774
Instead of relying only on hardcoded default value, first try to find out the actuall default value of a bool argument to a the class/attrib-maker decorators, and only if the value could not be extracted from the code, fall back to the default value defined in mypy.
This enables the correct handling of decorators which wrap attrs decorators but set different defaults, for example to kw_only.
Test Plan
This commit also adds two test cases. testAttrsWrappedDecorators tests the existing support for wrapping attrs decorators, via a "fake plugin" and testAttrsWrappedDecoratorsWithDifferentDefaults tests the new support for decorators that have different default values than the attrs decorators.
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉
Rebased on master and fixed fail.
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉
I think I'm ready for review :)
Hey, is it likely this PR would be reviewed if I resolve the new conflicts?
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉