mirror of
https://github.com/astral-sh/ruff
synced 2026-01-21 13:30:49 -05:00
## Summary Follow-up on https://github.com/astral-sh/ruff/pull/7528 that improves detections of mis-usages of policy in `paramiko`. First commit applies the same fix as in `bandit` (https://github.com/PyCQA/bandit/pull/1064), as `paramiko` supports passing both a class and a class instance for the policy in `set_missing_host_key_policy` (8e389c7766/paramiko/client.py (L171-L191)). Second commit improve the detection of `paramiko` import paths that trigger a violation, as `AutoAddPolicy`, `WarningPolicy` and `SSHClient` are not only exposed in `paramiko.client`, but also in `paramiko` (66117732de/paramiko/__init__.py (L121-L164)). ## Test Plan Snapshot tests.