Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Blumenkind111 opened this issue Dec 5, 2023 · 2 comments · Fixed by #9015
Closed

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

Blumenkind111 opened this issue Dec 5, 2023 · 2 comments · Fixed by #9015
Assignees
Labels
bug Something isn't working

Comments

@Blumenkind111
Copy link

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.

@charliermarsh charliermarsh added the bug Something isn't working label Dec 5, 2023
@charliermarsh
Copy link
Member

Thanks for filing!

@charliermarsh charliermarsh self-assigned this Dec 5, 2023
@charliermarsh
Copy link
Member

(The issue is the trailing comma.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants