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
[Merged by Bors] - refactor(*): scrub imports #17568
Conversation
fac' := by { rintros s (⟨⟩|⟨⟩); { ext x, simp only | ||
[binary_fan.π_app_right, binary_fan.π_app_left, Module.coe_comp, function.comp_app, | ||
linear_map.fst_apply, linear_map.snd_apply, linear_map.prod_apply, pi.prod], }, }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this an intended part of the diff?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this mysteriously slowed down. 🤷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked all the non-import changes with git diff c34a1aa4263bdf585dd705508c11d3b75836049e | grep '^[+-]' | grep -v '^[-+]import'
, and the imports should be fine as long as everything still builds. So let's get this merged quickly!
bors d+
✌️ semorrison can now approve this pull request. To approve and merge a pull request, simply reply with |
Thanks for the reviews. I have a local build success so I'm going to optimistically try this in bors. (I haven't yet built after merging the last master, so it may well fail.) |
bors merge p=10 |
For each file, we read each declaration and find the files containing each referenced declaration. This is the "needed" set. We then replace the imports with * imports which are needed * other needed files which would not otherwise be transitively imported Thus we don't remove any imports merely because they are transitively redundant. Instead we remove imports only if they are genuinely unnecessary. We also have to add back in imports (because they have been removed from higher up the import hierarchy). I've committed the Lean script (thanks Mario!) that generates the underlying data, but not the Mathematica notebook that does that import calculations and text replacement (because it's a mess, and I want this merged quickly before it rots). * We try not to reorder imports unnecessarily. * But we don't sort: anything new that needs to be added just comes after the existing imports. * This drops a few comments on `import` lines. * It replaces a few `import X` with `import X.default`. (I think this is not bad: we probably want to remove all the .default files anyway at some point.) Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
Build failed: |
bors merge p=10 |
For each file, we read each declaration and find the files containing each referenced declaration. This is the "needed" set. We then replace the imports with * imports which are needed * other needed files which would not otherwise be transitively imported Thus we don't remove any imports merely because they are transitively redundant. Instead we remove imports only if they are genuinely unnecessary. We also have to add back in imports (because they have been removed from higher up the import hierarchy). I've committed the Lean script (thanks Mario!) that generates the underlying data, but not the Mathematica notebook that does that import calculations and text replacement (because it's a mess, and I want this merged quickly before it rots). * We try not to reorder imports unnecessarily. * But we don't sort: anything new that needs to be added just comes after the existing imports. * This drops a few comments on `import` lines. * It replaces a few `import X` with `import X.default`. (I think this is not bad: we probably want to remove all the .default files anyway at some point.) Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
Build failed: |
bors merge p=10 |
For each file, we read each declaration and find the files containing each referenced declaration. This is the "needed" set. We then replace the imports with * imports which are needed * other needed files which would not otherwise be transitively imported Thus we don't remove any imports merely because they are transitively redundant. Instead we remove imports only if they are genuinely unnecessary. We also have to add back in imports (because they have been removed from higher up the import hierarchy). I've committed the Lean script (thanks Mario!) that generates the underlying data, but not the Mathematica notebook that does that import calculations and text replacement (because it's a mess, and I want this merged quickly before it rots). * We try not to reorder imports unnecessarily. * But we don't sort: anything new that needs to be added just comes after the existing imports. * This drops a few comments on `import` lines. * It replaces a few `import X` with `import X.default`. (I think this is not bad: we probably want to remove all the .default files anyway at some point.) Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
Pull request successfully merged into master. Build succeeded: |
This is another run of #17568, scrubbing unnecessary imports. Like last time we only remove genuinely unneeded imports, and leave merely transitively redundant imports alone. (I *still* disagree with the objectors to removing transitively redundant imports Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
This is another run of #17568, scrubbing unnecessary imports. Like last time we only remove genuinely unneeded imports, and leave merely transitively redundant imports alone. (I *still* disagree with the objectors to removing transitively redundant imports Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
For each file, we read each declaration and find the files containing each referenced declaration. This is the "needed" set. We then replace the imports with
Thus we don't remove any imports merely because they are transitively redundant. Instead we remove imports only if they are genuinely unnecessary. We also have to add back in imports (because they have been removed from higher up the import hierarchy).
I've committed the Lean script (thanks Mario!) that generates the underlying data, but not the Mathematica notebook that does that import calculations and text replacement (because it's a mess, and I want this merged quickly before it rots).
import
lines.import X
withimport X.default
. (I think this is not bad: we probably want to remove all the .default files anyway at some point.)