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

Update F481 autofix for Jupyter line magic expr #6116

Closed
Tracked by #5188
dhruvmanila opened this issue Jul 27, 2023 · 0 comments · Fixed by #6117 or #6141
Closed
Tracked by #5188

Update F481 autofix for Jupyter line magic expr #6116

dhruvmanila opened this issue Jul 27, 2023 · 0 comments · Fixed by #6117 or #6141
Assignees
Labels
rule Implementing or modifying a lint rule

Comments

@dhruvmanila
Copy link
Member

dhruvmanila commented Jul 27, 2023

If the assignment value is a line magic expression, the statement shouldn't be removed entirely i.e., the assignment statement should be refactored to a line magic statement:

- dir = !pwd
+ !pwd
@dhruvmanila dhruvmanila self-assigned this Jul 27, 2023
@dhruvmanila dhruvmanila added the rule Implementing or modifying a lint rule label Jul 27, 2023
@dhruvmanila dhruvmanila linked a pull request Jul 27, 2023 that will close this issue
charliermarsh pushed a commit that referenced this issue Jul 27, 2023
## Summary

Update `F841` autofix to not remove line magic expr

## Test Plan

Added test case for assignment statement with and without type
annotation

fixes: #6116
dhruvmanila added a commit that referenced this issue Aug 5, 2023
## Summary

Update `F841` autofix to not remove line magic expr

## Test Plan

Added test case for assignment statement with and without type
annotation

fixes: #6116
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rule Implementing or modifying a lint rule
Projects
None yet
1 participant