-
Notifications
You must be signed in to change notification settings - Fork 107
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
add --classmethod-decorators #405
Conversation
Hm, looks like the test fail is from |
|
Pydantic also has "root_validator" in 1.x versions, would be great to have it included by default as well |
I'm slightly hesitant to add several default decorators, if you can only extend and not replace the decorator list, especially given that matching on attributes is done only on the last part of the name. So if somebody were to add Alternatively I could deviate from pep8-naming's functionality, and make A bigger issue: It seems it's not possible to specify the same option in several flake8 plugins, I could maybe try to check the currently loaded plugins by digging into flake8 internals and only register |
Going with "replace, but have better defaults than pep8-naming" would probably solve this just fine for almost everyone? We could also send them a PR once we've decided, so we have the same defaults 🙂 |
@Zac-HD what about the name conflict? |
Hmm, can we ensure that we're loaded after |
okay that wasn't too tricky to resolve. Maybe some minor polish left but otherwise this is finished |
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.
Tiny docs nitpicks, but this looks great and otherwise ready to merge! Thanks again @jakkdl 😁
double-checked that it works when specified on the command line, and if specified in the config file (though got tripped up for a minute by the duplication between |
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.
Thanks for all the efforts here and reviews all. I think this will be welcomed by many. I'm happy to merge and release this ...
fixes #74
attributes are currently not handled at all, and not fully obvious how lenient/strict we want to be. As a first pass I'll probably require a full match, but if so one might want to support wildcards, otherwise we should maybe just match the final name. I'll probably go read up on how I handled stuff in flake8-trio and see if I can find the motivation
Should you require re-specifying
staticmethod
if specifying--classmethod-decorators
? That's how pep8-naming does it, but I have a very hard time seeing why you wouldn't want it enabled.TODO:
[pydantic].validator
by default