From d392ea5d8a11049a275207cf18e488bf19a57c69 Mon Sep 17 00:00:00 2001 From: Mark Byrne <31762852+mbyrnepr2@users.noreply.github.com> Date: Tue, 16 May 2023 10:34:47 +0200 Subject: Add new checker `kwarg-superseded-by-positional-arg` and fix a false positive (#8644) * Fix a false positive for ``redundant-keyword-arg`` when a function, with a keyword-only-parameter and ``**kwargs``, is called with a positional argument and a keyword argument where the keyword argument has the same name as the positional-only-parameter. * Add new checker ``kwarg-superseded-by-positional-arg`` which emits a warning message for the above scenario. Closes #8558 Co-authored-by: Pierre Sassoulas --- tests/functional/k/kwarg_superseded_by_positional_arg.txt | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 tests/functional/k/kwarg_superseded_by_positional_arg.txt (limited to 'tests/functional/k/kwarg_superseded_by_positional_arg.txt') diff --git a/tests/functional/k/kwarg_superseded_by_positional_arg.txt b/tests/functional/k/kwarg_superseded_by_positional_arg.txt new file mode 100644 index 000000000..15d527f7a --- /dev/null +++ b/tests/functional/k/kwarg_superseded_by_positional_arg.txt @@ -0,0 +1,2 @@ +kwarg-superseded-by-positional-arg:26:0:26:62::'apple' will be included in '**kwargs' since a positional-only parameter with this name already exists:HIGH +kwarg-superseded-by-positional-arg:39:0:39:24::'apple' will be included in '**kwargs' since a positional-only parameter with this name already exists:HIGH -- cgit v1.2.1