From df296fbac1795054cb3b14c4f728c1360298ed92 Mon Sep 17 00:00:00 2001 From: Dan Date: Wed, 19 Nov 2025 19:02:46 -0500 Subject: [PATCH] Remove unnecessary keyword argument checks --- .../src/rules/flake8_use_pathlib/helpers.rs | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/crates/ruff_linter/src/rules/flake8_use_pathlib/helpers.rs b/crates/ruff_linter/src/rules/flake8_use_pathlib/helpers.rs index 8b472c9625..490af45e2f 100644 --- a/crates/ruff_linter/src/rules/flake8_use_pathlib/helpers.rs +++ b/crates/ruff_linter/src/rules/flake8_use_pathlib/helpers.rs @@ -73,18 +73,6 @@ pub(crate) fn check_os_pathlib_single_arg_calls( return; } - // If there are keyword arguments other than `dir_fd` or the main argument, skip - // We need to allow the main argument to be passed as a keyword, and `dir_fd=None` - // Note: `dir_fd` non-default value checking is done by the caller before invoking this helper - let allowed_keywords = if has_keyword_arg { - &[fn_argument, "dir_fd"][..] - } else { - &["dir_fd"][..] - }; - if has_unknown_keywords_or_starred_expr(&call.arguments, allowed_keywords) { - return; - } - let Some(arg) = call.arguments.find_argument_value(fn_argument, 0) else { return; };