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 F841 autofix to not remove line magic expr #6117

Merged
merged 1 commit into from
Jul 27, 2023

Conversation

dhruvmanila
Copy link
Member

@dhruvmanila dhruvmanila commented 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
Copy link
Member Author

dhruvmanila commented Jul 27, 2023

@dhruvmanila dhruvmanila requested a review from konstin July 27, 2023 05:17
@github-actions
Copy link
Contributor

github-actions bot commented Jul 27, 2023

PR Check Results

Ecosystem

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

typeshed (+0, -4)

- stubs/Pillow/PIL/_imaging.pyi:12:7: PYI046 Private protocol `_PixelAccessor` is never used
- stubs/bleach/bleach/callbacks.pyi:9:7: PYI046 Private protocol `_Callback` is never used
- stubs/openpyxl/openpyxl/xml/_functions_overloads.pyi:26:7: PYI046 Private protocol `_HasTagAndText` is never used
- stubs/openpyxl/openpyxl/xml/_functions_overloads.pyi:28:7: PYI046 Private protocol `_HasTagAndTextAndAttrib` is never used

Rules changed: 1
Rule Changes Additions Removals
PYI046 4 0 4

Benchmark

Linux

group                                      main                                   pr
-----                                      ----                                   --
formatter/large/dataset.py                 1.00      8.5±0.08ms     4.8 MB/sec    1.00      8.6±0.15ms     4.8 MB/sec
formatter/numpy/ctypeslib.py               1.00  1686.6±17.93µs     9.9 MB/sec    1.01  1705.8±36.93µs     9.8 MB/sec
formatter/numpy/globals.py                 1.00    192.5±6.98µs    15.3 MB/sec    1.01    193.8±5.98µs    15.2 MB/sec
formatter/pydantic/types.py                1.00      3.6±0.09ms     7.0 MB/sec    1.01      3.7±0.09ms     6.9 MB/sec
linter/all-rules/large/dataset.py          1.00     11.8±0.03ms     3.4 MB/sec    1.00     11.8±0.03ms     3.4 MB/sec
linter/all-rules/numpy/ctypeslib.py        1.00      3.0±0.02ms     5.5 MB/sec    1.00      3.0±0.03ms     5.5 MB/sec
linter/all-rules/numpy/globals.py          1.00    397.0±0.88µs     7.4 MB/sec    1.00    397.8±1.12µs     7.4 MB/sec
linter/all-rules/pydantic/types.py         1.00      5.4±0.11ms     4.7 MB/sec    1.00      5.4±0.08ms     4.7 MB/sec
linter/default-rules/large/dataset.py      1.00      5.8±0.04ms     7.0 MB/sec    1.01      5.9±0.05ms     6.9 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.00  1227.6±11.42µs    13.6 MB/sec    1.01  1236.4±18.49µs    13.5 MB/sec
linter/default-rules/numpy/globals.py      1.03    138.2±6.48µs    21.3 MB/sec    1.00    134.6±0.58µs    21.9 MB/sec
linter/default-rules/pydantic/types.py     1.00      2.6±0.06ms     9.8 MB/sec    1.01      2.6±0.05ms     9.7 MB/sec

Windows

group                                      main                                    pr
-----                                      ----                                    --
formatter/large/dataset.py                 1.00     10.5±0.53ms     3.9 MB/sec     1.27     13.4±1.03ms     3.0 MB/sec
formatter/numpy/ctypeslib.py               1.00  1984.1±101.60µs     8.4 MB/sec    1.34      2.7±0.14ms     6.3 MB/sec
formatter/numpy/globals.py                 1.00   230.4±17.09µs    12.8 MB/sec     1.08   248.4±24.82µs    11.9 MB/sec
formatter/pydantic/types.py                1.00      4.3±0.21ms     5.9 MB/sec     1.25      5.4±0.58ms     4.7 MB/sec
linter/all-rules/large/dataset.py          1.09     18.7±0.80ms     2.2 MB/sec     1.00     17.1±0.38ms     2.4 MB/sec
linter/all-rules/numpy/ctypeslib.py        1.10      5.0±0.22ms     3.3 MB/sec     1.00      4.5±0.17ms     3.7 MB/sec
linter/all-rules/numpy/globals.py          1.11   617.6±52.83µs     4.8 MB/sec     1.00   558.1±25.21µs     5.3 MB/sec
linter/all-rules/pydantic/types.py         1.09      8.4±0.36ms     3.0 MB/sec     1.00      7.7±0.22ms     3.3 MB/sec
linter/default-rules/large/dataset.py      1.12     10.6±0.83ms     3.8 MB/sec     1.00      9.4±0.42ms     4.3 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.00  1780.7±195.19µs     9.4 MB/sec    1.13      2.0±0.12ms     8.3 MB/sec
linter/default-rules/numpy/globals.py      1.00   190.2±11.09µs    15.5 MB/sec     1.19   225.4±13.42µs    13.1 MB/sec
linter/default-rules/pydantic/types.py     1.00      3.5±0.16ms     7.3 MB/sec     1.23      4.3±0.19ms     5.9 MB/sec

@@ -562,6 +562,18 @@ print("after empty cells")
Ok(())
}

#[test]
fn test_unused_variable() -> Result<()> {
Copy link
Member

Choose a reason for hiding this comment

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

When these tests get more we can at some point move them into #[test_case]

@dhruvmanila dhruvmanila linked an issue Jul 27, 2023 that may be closed by this pull request
@charliermarsh charliermarsh merged commit 1a436d3 into dhruv/jupyter-cell-magic Jul 27, 2023
@charliermarsh charliermarsh deleted the dhruv/F841-line-magic-expr branch July 27, 2023 18:55
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.

Update F481 autofix for Jupyter line magic expr
4 participants