Skip to content
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 superfluous-else rules for raise, continue and break (RET506, RET507, RET508) #4565

Merged
merged 4 commits into from
Oct 27, 2024

Conversation

echoix
Copy link
Member

@echoix echoix commented Oct 21, 2024

Following #4459, where when there was an if with a return, the next elif: or else: could be flattened with one less nested level, this PR addresses three similar rules, where instead of having return, there is RET506 for a raise, RET507 for continue in a loop, and RET508 for a break in a loop.

There are only 35 changes files, and quite simple, but in a couple of files, there was a lot of nested conditions/long nested conditions that became flattened and got reformatted with fewer lines. So the line change count is bigger than it appears.

@echoix echoix requested a review from ninsbl October 21, 2024 02:05
@github-actions github-actions bot added GUI wxGUI related vector Related to vector data processing raster Related to raster data processing temporal Related to temporal data processing Python Related code is in Python database Related to database management libraries module docs labels Oct 21, 2024
@echoix
Copy link
Member Author

echoix commented Oct 21, 2024

I'm not 100% sure that there won't be conflicts with my other open PRs. Please take a look at the others that are already ready before this one.

@echoix echoix changed the title Fix ret506 ret507 ret508 superfluous else style: Fix superfluous-else rules for raise, continue and break (RET506, RET507, RET508) Oct 21, 2024
@echoix echoix merged commit 7910777 into OSGeo:main Oct 27, 2024
26 checks passed
@echoix echoix deleted the fix-RET506-RET507-RET508-superfluous-else branch October 27, 2024 09:24
@github-actions github-actions bot added this to the 8.5.0 milestone Oct 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
database Related to database management docs GUI wxGUI related libraries module Python Related code is in Python raster Related to raster data processing temporal Related to temporal data processing vector Related to vector data processing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants