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

Merged
merged 6 commits into from
Aug 8, 2024
Merged

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
Copy link
Member

@brettcannon brettcannon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine w/ the changes if @pradyunsg is.

	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.
@brettcannon brettcannon merged commit 6c5698a into pypa:main Aug 8, 2024
32 checks passed
@brettcannon
Copy link
Member

Since @pradyunsg hasn't said anything in a month I decided to go ahead and merge.

Thanks, @DimitriPapadopoulos !

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

3 participants