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

Apply ruff/bugbear rules (B) #787

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

Conversation

DimitriPapadopoulos
Copy link
Contributor

B904 Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling

https://docs.astral.sh/ruff/rules/raise-without-from-inside-except/

B018 Found useless expression. Either assign it to a variable or remove it.

https://docs.astral.sh/ruff/rules/useless-expression/

Also, do not ignore ruff/bugbear rule B015 and B009:
https://docs.astral.sh/ruff/rules/useless-comparison/
https://docs.astral.sh/ruff/rules/get-attr-with-constant/

@DimitriPapadopoulos DimitriPapadopoulos changed the title Fix ruff/bugbear issues (UP) Fix ruff/bugbear issues (B) Mar 10, 2024
src/packaging/metadata.py Outdated Show resolved Hide resolved
	B904 Within an `except` clause, raise exceptions with `raise ... from err` or
	     `raise ... from None` to distinguish them from errors in exception handling
	B028 No explicit `stacklevel` keyword argument found
	B018 Found useless expression. Either assign it to a variable or remove it.
@DimitriPapadopoulos DimitriPapadopoulos changed the title Fix ruff/bugbear issues (B) Apply ruff/bugbear rules (B) May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants