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 implicit-return-value (RET502) & unnecessary-return-none (RET501) #5030

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

echoix
Copy link
Member

@echoix echoix commented Feb 2, 2025

RET501: Do not explicitly return None in function if it is the only possible return value (5 changes)
RET502: Do not implicitly return None in function able to return non-None value (about 30 changes)

Ruff rules: https://docs.astral.sh/ruff/rules/implicit-return-value/ and https://docs.astral.sh/ruff/rules/unnecessary-return-none/

When a function can return something else than None, make it clear that a simple return is implicitly returning None. This is what RET502 is about. If the function only returns None, then use implicit return instead.

RET502: Do not implicitly `return None` in function able to return non-`None` value

Ruff rule: https://docs.astral.sh/ruff/rules/implicit-return-value/
RET501 [*] Do not explicitly `return None` in function if it is the only possible return value

Ruff rule: https://docs.astral.sh/ruff/rules/unnecessary-return-none/
@echoix echoix changed the title style: Fix implicit-return-value (RET502) style: Fix implicit-return-value (RET502) & unnecessary-return-none (RET501) Feb 2, 2025
@github-actions github-actions bot added GUI wxGUI related raster Related to raster data processing Python Related code is in Python libraries module general labels Feb 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
general GUI wxGUI related libraries module Python Related code is in Python raster Related to raster data processing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant