Skip to content

[Fix error]Unpacking an empty dict with PIE804 #9014

@Blumenkind111

Description

@Blumenkind111

Hi all,

The following code seems to be unformattable by ruff with Rule PIE804

def test_function(*args, **kwargs):
pass

test_function(
arg1=1016,
arg2=25.4,
**{},
)

The error is: error: Fix introduced a syntax error. Reverting all changes.

I could break it down to this setting: ruff check testfile.py --select=PIE804 --fix

version is ruff 0.1.7

It's quite obvious, that ruff fails to unpack the empty dict into keyword-arguments, but when reformatting an old codebase it would be nice, if this (admittedly quite sketchy piece of code) would not crash the fix for the complete file.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions