-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Refactor: Consolidate import and usage of random #34108
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
Conversation
4f6dcbf to
6ecc955
Compare
tests/models/test_cleartasks.py
Outdated
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.
Wow this entire function can use a rewrite. (Not saying you should do it in this PR.)
Lee-W
left a comment
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.
Same as #34113. I'm wondering why we want to consolidate imports this way. Does that mean we should avoid from ... import ... pattern.
I'm suggesting having all imported modules/classes the same way, so in this case there's always There are cases where I do |
Yep, agree unifying them would be great 👍 Do we want to document it somewhere? (e.g., use |
|
I think those kind of rules are rarely read and we have two approaches there that 'work' a) hope that people will follow what is in the code (not perfect but mostly works) - this is a stage we are currently in b) better - add pre-commit to do ast parsing and add rules of things we want do not want to have. I'd say it would be great if thos unification that can be done (imports are generally easy) are added as a rule to pre-commits Maybe you can work with @eumiro together to determine the list of rules that can be automatically verified and and write a pre&commit doing it ? |
(cherry picked from commit 4fa66d1)
No description provided.