ruff
F401 - Recommend adding unused import bindings to `__all__`
#11314
Merged

F401 - Recommend adding unused import bindings to `__all__` #11314

plredmond merged 49 commits into main from ruff.__all__
plredmond
plredmond
github-actions
plredmond plredmond marked this pull request as ready for review 1 year ago
MichaReiser
MichaReiser commented on 2024-05-07
AlexWaygood
AlexWaygood commented on 2024-05-07
plredmond
AlexWaygood
AlexWaygood commented on 2024-05-07
plredmond plredmond requested a review from AlexWaygood AlexWaygood 1 year ago
AlexWaygood
AlexWaygood commented on 2024-05-08
AlexWaygood
AlexWaygood commented on 2024-05-08
AlexWaygood
AlexWaygood commented on 2024-05-09
plredmond
plredmond
AlexWaygood
AlexWaygood commented on 2024-05-10
plredmond plredmond requested a review from zanieb zanieb 1 year ago
plredmond
zanieb
zanieb approved these changes on 2024-05-14
charliermarsh
charliermarsh commented on 2024-05-14
charliermarsh
charliermarsh commented on 2024-05-14
charliermarsh
charliermarsh commented on 2024-05-14
charliermarsh
codspeed-hq
charliermarsh
plredmond
AlexWaygood
plredmond
plredmond Revert "patch to remove the unfinished dunder_all mutation"
fe7016ee
plredmond charlie patch w/proto dunder_all finder
41584e17
plredmond find_dunder_all_expr implemented
61cca6c7
plredmond pass ExprList to fix_by_reexporting
453c905a
plredmond slight cleanup of branch arms readability
628053ed
plredmond rename F401_25__all fixture test to F401_25__all_nonempty
59d96aeb
plredmond remove unnecessary pattern match
5b1f3e58
plredmond new field in ImportBinding which is the name of the binding
1d16c8be
plredmond change fix_bind_reexporting call add_to_dunder_all with the list of b…
ff5f82f7
plredmond uncomment and review test cases for F401_25 fixture test
93f0bc31
plredmond add edit to insert binding names into __all__
07bd559f
plredmond fixture tests to more thoroughly explore the cases of the "add to __a…
4c389502
plredmond cargo clippy edits -- map..or to map_or and single-pattern match to i…
f5370cbd
plredmond include the binding name in UnusedImport; when it is not the suffix o…
db7cbb5c
plredmond accept fixture test changes that show the binding when it differs fro…
1ad23f88
plredmond accept stylist argument to place correct quotes around binders added …
2a72d341
plredmond use Expr instead of ExprList to convey dunder_all value to the edit-p…
494e56d5
plredmond clippy again
a54ea9dc
plredmond change make_redundant_alias to take an iter of Cow to simplify caller
99fd1f68
plredmond rewrite add_to_dunder_all and its tests
c8dc342b
plredmond shakes fist at cloud and yells, "Clippy!!!"
188a232d
plredmond change message for redundant-aliases
877800ec
plredmond use binding method instead of accessing the field
d5978f9d
plredmond use filter_map followed by last to obtain the first __all__ binding
86f30e7a
plredmond update fixture test to reflect that we add to the first binding of __…
7f092bf2
plredmond fixture test to demonstrate how we treat __all__ followed by a condit…
1d0f3cab
plredmond do not offer a fix to add to __all__ when there is more than one __al…
3e284b61
plredmond delete F401_29 fixture test
7f3335d0
plredmond rename F401_30 fixture test to F401_29
097ce551
plredmond add unused-import case to F401_29 fixture test
5beb13f4
plredmond change `find_dunder_all_expr` to `find_dunder_all_exprs` and track th…
92a7a43f
plredmond change find_dunder_all_exprs to return /all/ such exprs regardless of…
190d1917
plredmond change fix-title for redundant alias case to format itself and return…
6035e1d9
plredmond use if-let instead of match with empty branch per alex
c81506ae
plredmond Update crates/ruff_linter/src/fix/edits.rs
bb545a23
plredmond wording improvement per alex
1cbf320d
plredmond replace into::Into with Cow::from to make conversion explicit
64c17e25
plredmond improve the wording of "add unused import to __all__" message per alex
a7478977
plredmond reformat a function -- noop w.r.t. the tests
edc88f3d
plredmond remove a now unnecessary branch, which also makes the overall PR diff…
117a1f06
plredmond call .end() directly instead of going through .range or .range(); rem…
1b167e61
plredmond readd erroneously removed newlines to fixture snaps
26d4714b
plredmond ruff format the fixture __init__.py files
5dbdcfe1
plredmond cargo insta review -- accept whitespace changes (see `git diff -w`)
64fa9af0
plredmond clippy fix -- replace closure with static reference to method
527d3954
plredmond plredmond force pushed from 31dd04dd to 527d3954 1 year ago
plredmond
plredmond
charliermarsh
charliermarsh commented on 2024-05-14
charliermarsh
charliermarsh
charliermarsh
charliermarsh
AlexWaygood
AlexWaygood commented on 2024-05-14
plredmond collect only 2 `__all__` definitions and then stop pulling the iterator
548180b3
plredmond Revert "collect only 2 `__all__` definitions and then stop pulling th…
01e974fa
plredmond remove the qualified-name field from UnusedImport in favor of the bin…
0696df52
plredmond
plredmond
plredmond Revert "remove the qualified-name field from UnusedImport in favor of…
dde97562
plredmond
charliermarsh
plredmond plredmond merged da882b66 into main 1 year ago
plredmond plredmond deleted the ruff.__all__ branch 1 year ago

Login to write a write a comment.

Login via GitHub

Assignees
No one assigned
Labels
Milestone