Skip to content

[Merged by Bors] - chore: import Mathlib.Init in all files#18277

Closed
grunweg wants to merge 4 commits intomasterfrom
MR-import-mathlib.init
Closed

[Merged by Bors] - chore: import Mathlib.Init in all files#18277
grunweg wants to merge 4 commits intomasterfrom
MR-import-mathlib.init

Conversation

@grunweg
Copy link
Copy Markdown
Contributor

@grunweg grunweg commented Oct 27, 2024

This manually adds 'import Mathlib.Init' to all files which are currently missing this.
A future PR will add an automatic check for this.


This PR itself is easy to review: it just adds that one import. The fact that everything builds shows there is no import cycle.

The large-imports changes are by design (and show this change does something).

Open in Gitpod

@grunweg grunweg added the easy < 20s of review time. See the lifecycle page for guidelines. label Oct 27, 2024
@grunweg grunweg requested a review from adomani October 27, 2024 10:02
@github-actions github-actions bot added the large-import Automatically added label for PRs with a significant increase in transitive imports label Oct 27, 2024
@github-actions
Copy link
Copy Markdown

github-actions bot commented Oct 27, 2024

PR summary 658bbaaae9

Import changes exceeding 2%

% File
+1700.00% Mathlib.Data.Nat.BinaryRec
+1700.00% Mathlib.Data.Stream.Defs
+1700.00% Mathlib.Deprecated.Logic
+1700.00% Mathlib.Std.Data.HashMap
+1700.00% Mathlib.Tactic.CategoryTheory.Coherence.Datatypes
+1600.00% Mathlib.Tactic.Linter.AdmitLinter
+800.00% Mathlib.Tactic.Linter.FlexibleLinter
+1600.00% Mathlib.Tactic.StacksAttribute
+1700.00% Mathlib.Util.AssertExistsExt

Import changes for modified files

Dependency changes

File Base Count Head Count Change
Mathlib.Data.Nat.BinaryRec 1 18 +17 (+1700.00%)
Mathlib.Data.Stream.Defs 1 18 +17 (+1700.00%)
Mathlib.Deprecated.Logic 1 18 +17 (+1700.00%)
Mathlib.Std.Data.HashMap 1 18 +17 (+1700.00%)
Mathlib.Tactic.CategoryTheory.Coherence.Datatypes 1 18 +17 (+1700.00%)
Mathlib.Util.AssertExistsExt 1 18 +17 (+1700.00%)
Mathlib.Tactic.Linter.AdmitLinter 1 17 +16 (+1600.00%)
Mathlib.Tactic.StacksAttribute 1 17 +16 (+1600.00%)
Mathlib.Tactic.Linter.FlexibleLinter 2 18 +16 (+800.00%)
Import changes for all files
Files Import difference
3 files Mathlib.Tactic.StacksAttribute Mathlib.Tactic.Linter.AdmitLinter Mathlib.Tactic.Linter.FlexibleLinter
16
14 files Mathlib.Data.Int.DivMod Mathlib.Tactic.CategoryTheory.Coherence.Datatypes Mathlib.Data.Nat.BinaryRec Mathlib.Tactic.CC.Lemmas Mathlib.Tactic.CategoryTheory.Coherence.PureCoherence Mathlib.Tactic.Linter.TextBased Mathlib.Std.Data.HashMap Mathlib.Util.AssertExistsExt Mathlib.Deprecated.Combinator Mathlib.Logic.OpClass Mathlib.Tactic.CategoryTheory.Coherence.Normalize Mathlib.Data.Stream.Defs Mathlib.Deprecated.Logic Mathlib.Data.Nat.Notation
17

Declarations diff

No declarations were harmed in the making of this PR! 🐙

You can run this locally as follows
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>

The doc-module for script/declarations_diff.sh contains some details about this script.

This manually adds 'import Mathlib.Init' to all files which are currently missing this.
A future PR will add an automatic check for this.
@grunweg grunweg force-pushed the MR-import-mathlib.init branch from 02436ae to fbc0b2d Compare October 27, 2024 11:13
Stream'.corec' was pre-existing; add it to the exceptions list
Copy link
Copy Markdown
Contributor

@Ruben-VandeVelde Ruben-VandeVelde left a comment

Choose a reason for hiding this comment

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

maintainer merge

@github-actions
Copy link
Copy Markdown

🚀 Pull request has been placed on the maintainer queue by Ruben-VandeVelde.

@github-actions github-actions bot added the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Oct 27, 2024
@bryangingechen bryangingechen added the awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. label Oct 27, 2024
@bryangingechen
Copy link
Copy Markdown
Contributor

I'm guessing the motivation is this thread? Could you add a word or two to the PR description about it?

@grunweg
Copy link
Copy Markdown
Contributor Author

grunweg commented Oct 27, 2024

In fact, my motivation is unrelated to that: as I understand it, upon Mathlib.Init''s creation, the idea was that every file in Mathlib should import it --- this was just postponed to a later PR and never enforced so far. This PR is an easy way to enforce it.

@grunweg
Copy link
Copy Markdown
Contributor Author

grunweg commented Oct 27, 2024

If you think the zulip thread you reference is also useful motivation, feel free to add it to the description!

@bryangingechen
Copy link
Copy Markdown
Contributor

Reading over the thread again, I'm not sure that it's relevant anymore... I guess there's a tradeoff here between making the imports consistent and keeping a handful of files slightly lighter (many of them seem like they won't be imported without the rest of mathlib anyways).

bors d=adomani

@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Oct 27, 2024

✌️ adomani can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@github-actions github-actions bot added the delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). label Oct 27, 2024
@github-actions github-actions bot removed the awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. label Oct 27, 2024
@adomani
Copy link
Copy Markdown
Contributor

adomani commented Oct 28, 2024

Thanks!

Another consequence of importing Init everywhere is that the style linters will lint most files.

bors merge

mathlib-bors bot pushed a commit that referenced this pull request Oct 28, 2024
This manually adds 'import Mathlib.Init' to all files which are currently missing this.
A future PR will add an automatic check for this.
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Oct 28, 2024

Build failed (retrying...):

mathlib-bors bot pushed a commit that referenced this pull request Oct 28, 2024
This manually adds 'import Mathlib.Init' to all files which are currently missing this.
A future PR will add an automatic check for this.
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Oct 28, 2024

Build failed (retrying...):

mathlib-bors bot pushed a commit that referenced this pull request Oct 28, 2024
This manually adds 'import Mathlib.Init' to all files which are currently missing this.
A future PR will add an automatic check for this.
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Oct 28, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title chore: import Mathlib.Init in all files [Merged by Bors] - chore: import Mathlib.Init in all files Oct 28, 2024
@mathlib-bors mathlib-bors bot closed this Oct 28, 2024
@mathlib-bors mathlib-bors bot deleted the MR-import-mathlib.init branch October 28, 2024 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). easy < 20s of review time. See the lifecycle page for guidelines. large-import Automatically added label for PRs with a significant increase in transitive imports maintainer-merge A reviewer has approved the changed; awaiting maintainer approval.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants