-
-
Notifications
You must be signed in to change notification settings - Fork 307
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
style: Fix yoda-conditions (SIM300) #4044
Conversation
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.
The changes in spatial_extent.py are less obvious yoda comparisons as both sides are variables... Do you know why the order is changed there? Just curios for future programing...
I know, I double checked and was finding it weird at first. I was about to place an ignore directive. Yoda conditions are where the constants are at the left instead of right, and the single letter variables (W, E, N, S) are defined as literals (that is, a single constant value). Since the complete expressions were already complex enough for me to understand, I judged that it wasn't worse with it reversed, for anyone new that would need to read the code. |
You're seeing that the changes are starting to be a bit more opinionated, as a lot of the big easy changes are already made. There's also a big batch of single-violation fixes to do, (see the ruff tracking issue I made the other day) but I'm not sure how to combine them properly in a PR. Do you rather have a series of about 12-20 PRs that only have one violation to fix, but also helps tracking down what violations are enabled? |
As you prefer. I am fine with either approach... |
Thanks again for taking the time to read these PRs for me. I hope you don't mind that I assign to you these. At least the PRs gets a first answer in less than a week. Thanks again! |
I need to solve conflicts now, and will probably have to re-approve |
I am finally back at a PC and can do more efficient reviews, compared to reviewing on a mobile phone... Happy to do batches of PRs when I have some available time... |
Ruff rule: https://docs.astral.sh/ruff/rules/yoda-conditions/