From d0a1e201a363d77e141724b7bb422d290a8f115b Mon Sep 17 00:00:00 2001 From: Mikael Arguedas Date: Tue, 2 Jan 2024 02:59:11 +0100 Subject: [PATCH] [S507] fix doc recommended fix (#9347) paramiko `set_missing_host_key_policy` has mandatory positional arg. The [current documentation](https://docs.astral.sh/ruff/rules/ssh-no-host-key-verification/#example) leads to non-running code ``` >>> from paramiko import client >>> ssh_client = client.SSHClient() >>> ssh_client.set_missing_host_key_policy() Traceback (most recent call last): File "", line 1, in TypeError: SSHClient.set_missing_host_key_policy() missing 1 required positional argument: 'policy' ``` This PR modifies the documentation to set the policy to the [default `RejectPolicy`](https://docs.paramiko.org/en/latest/api/client.html#paramiko.client.SSHClient.set_missing_host_key_policy) Signed-off-by: Mikael Arguedas --- .../rules/flake8_bandit/rules/ssh_no_host_key_verification.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ruff_linter/src/rules/flake8_bandit/rules/ssh_no_host_key_verification.rs b/crates/ruff_linter/src/rules/flake8_bandit/rules/ssh_no_host_key_verification.rs index ba7cdf6134..03b9eb3473 100644 --- a/crates/ruff_linter/src/rules/flake8_bandit/rules/ssh_no_host_key_verification.rs +++ b/crates/ruff_linter/src/rules/flake8_bandit/rules/ssh_no_host_key_verification.rs @@ -28,7 +28,7 @@ use crate::checkers::ast::Checker; /// from paramiko import client /// /// ssh_client = client.SSHClient() -/// ssh_client.set_missing_host_key_policy() +/// ssh_client.set_missing_host_key_policy(client.RejectPolicy) /// ``` /// /// ## References