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

Upgrade mutable-argument-defaults to unsafe #8108

Conversation

cjolowicz
Copy link
Contributor

@cjolowicz cjolowicz commented Oct 21, 2023

Summary

Fixes #8104

Test Plan

Covered by snapshot tests.

@github-actions
Copy link

github-actions bot commented Oct 21, 2023

PR Check Results

Ecosystem

ℹ️ ecosystem check detected changes. (+3, -3, 0 error(s))

airflow (+1, -1)

- [*] 16165 fixable with the `--fix` option (6215 hidden fixes can be enabled with the `--unsafe-fixes` option).
+ [*] 16165 fixable with the `--fix` option (6225 hidden fixes can be enabled with the `--unsafe-fixes` option).

bokeh (+1, -1)

- [*] 17800 fixable with the `--fix` option (4370 hidden fixes can be enabled with the `--unsafe-fixes` option).
+ [*] 17800 fixable with the `--fix` option (4404 hidden fixes can be enabled with the `--unsafe-fixes` option).

latch (+1, -1)

- [*] 206 fixable with the `--fix` option (35 hidden fixes can be enabled with the `--unsafe-fixes` option).
+ [*] 206 fixable with the `--fix` option (40 hidden fixes can be enabled with the `--unsafe-fixes` option).

@@ -197,5 +197,5 @@ fn move_initialization(
}

let initialization_edit = Edit::insertion(content, pos);
Some(Fix::display_edits(default_edit, [initialization_edit]))
Some(Fix::unsafe_edits(default_edit, [initialization_edit]))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @charliermarsh

Can we add a note here explaining why the fix is unsafe? I'm not sure why it was marked as unapplicable originally as the fix looks relatively safe to me?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented on this in the issue: #8104 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a Known problems section to explain why the fix is unsafe.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@cjolowicz cjolowicz force-pushed the upgrade-mutable-argument-default-to-unsafe branch from e25ed58 to 8f6247a Compare October 21, 2023 16:31
@cjolowicz cjolowicz force-pushed the upgrade-mutable-argument-default-to-unsafe branch from 8f6247a to 9edcb67 Compare October 21, 2023 16:32
@charliermarsh charliermarsh merged commit 2414f23 into astral-sh:main Oct 21, 2023
16 checks passed
@cjolowicz cjolowicz deleted the upgrade-mutable-argument-default-to-unsafe branch October 21, 2023 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

B006 (mutable-argument-default) no longer offers autofix even with --unsafe-fixes
3 participants