Skip to content

[refurb] Guard hashlib imports and mark hashlib-digest-hex fix as safe (FURB181)#14694

Merged
charliermarsh merged 1 commit intoastral-sh:mainfrom
sbrugman:hashlib-digest-hex-safe
Dec 2, 2024
Merged

[refurb] Guard hashlib imports and mark hashlib-digest-hex fix as safe (FURB181)#14694
charliermarsh merged 1 commit intoastral-sh:mainfrom
sbrugman:hashlib-digest-hex-safe

Conversation

@sbrugman
Copy link
Contributor

Summary

  • Check if hashlib and crypt imports have been seen for FURB181 and S324
  • Mark the fix for FURB181 as safe: I think it was accidentally marked as unsafe in the first place. The rule does not support user-defined classes as the "fix safety" section suggests.
  • Removed hashlib._Hash, as it's not part of the hashlib module.

Test Plan

Updated the test snapshots

@github-actions
Copy link
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Copy link
Member

@charliermarsh charliermarsh left a comment

Choose a reason for hiding this comment

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

This makes sense, thanks.

@charliermarsh charliermarsh merged commit 48ec3a8 into astral-sh:main Dec 2, 2024
@charliermarsh charliermarsh added the fixes Related to suggested fixes for violations label Dec 2, 2024
@sbrugman sbrugman deleted the hashlib-digest-hex-safe branch December 2, 2024 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fixes Related to suggested fixes for violations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants