Skip to content

[Merged by Bors] - chore: import the header linter in all files imported in Mathlib.Init - #18275

Closed
grunweg wants to merge 7 commits into
masterfrom
MR-import-header-linter
Closed

grunweg wants to merge 7 commits into
masterfrom
MR-import-header-linter

Conversation

@grunweg

@grunweg grunweg commented Oct 27, 2024 •

Copy link
Copy Markdown
Contributor

Every file importing Mathlib.Init transitively imports this file already, thus having its module docstring and copyright header checked by the header linter. This adds the same input to every file imported in Mathlib.Init.

Helps with #17556.


Open in Gitpod

Every file importing Mathlib.Init transitively imports this file already,
thus having its module docstring and copyright header checked by the header
linter. This adds the same input to every file *imported in* Mathlib.Init.

Helps with #17556.
@grunweg
grunweg requested a review from adomani October 27, 2024 09:48
@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

github-actions Bot commented Oct 27, 2024 •

Copy link
Copy Markdown

PR summary d8159021a3

Import changes exceeding 2%

% File
+100.00% Mathlib.Tactic.DeclarationNames
+1700.00% Mathlib.Tactic.Finiteness.Attr
+100.00% Mathlib.Tactic.Linter.DocPrime
+100.00% Mathlib.Tactic.Linter.GlobalAttributeIn
+100.00% Mathlib.Tactic.Linter.HashCommandLinter
+100.00% Mathlib.Tactic.Linter.Multigoal
+100.00% Mathlib.Tactic.Linter.OldObtain
+100.00% Mathlib.Tactic.Linter.RefineLinter
+100.00% Mathlib.Tactic.Linter.Style
+50.00% Mathlib.Tactic.Linter.UnusedTactic

Import changes for modified files

Dependency changes

File Base Count Head Count Change
Mathlib.Tactic.Finiteness.Attr 1 18 +17 (+1700.00%)
Mathlib.Tactic.DeclarationNames 2 4 +2 (+100.00%)
Mathlib.Tactic.Linter.DocPrime 1 2 +1 (+100.00%)
Mathlib.Tactic.Linter.GlobalAttributeIn 1 2 +1 (+100.00%)
Mathlib.Tactic.Linter.HashCommandLinter 1 2 +1 (+100.00%)
Mathlib.Tactic.Linter.Multigoal 1 2 +1 (+100.00%)
Mathlib.Tactic.Linter.OldObtain 1 2 +1 (+100.00%)
Mathlib.Tactic.Linter.RefineLinter 1 2 +1 (+100.00%)
Mathlib.Tactic.Linter.Style 1 2 +1 (+100.00%)
Mathlib.Tactic.Linter.UnusedTactic 2 3 +1 (+50.00%)
Import changes for all files
Files Import difference
8 files Mathlib.Tactic.Linter.OldObtain Mathlib.Tactic.Linter.Multigoal Mathlib.Tactic.Linter.DocPrime Mathlib.Tactic.Linter.GlobalAttributeIn Mathlib.Tactic.Linter.UnusedTactic Mathlib.Tactic.Linter.RefineLinter Mathlib.Tactic.Linter.HashCommandLinter Mathlib.Tactic.Linter.Style
1
Mathlib.Tactic.DeclarationNames Mathlib.Tactic.Linter.Lint 2
Mathlib.Tactic.Finiteness.Attr 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.

@github-actions github-actions Bot added the t-linter Linter label Oct 27, 2024
@adomani

adomani commented Oct 28, 2024

Copy link
Copy Markdown
Contributor

Since I doubt that the Header import is going to be used for importing any function other than the linter, maybe it makes sense to add the file to the part of shake where the files that are globally ignored go, so that then it does not need to be shaken out in every individual import.

@grunweg

grunweg commented Oct 28, 2024

Copy link
Copy Markdown
Contributor Author

I don't feel strongly about this - if you think this is useful, I'm happy to do that instead.

And remove Mathlib.Init.Align, which does not exist any more.
@grunweg

grunweg commented Oct 29, 2024

Copy link
Copy Markdown
Contributor Author

Actually: yes, that seems like a nice simplification - and #18281 will flag any new files which import just the Header linter, so this is not likely to regress unintendedly. Changed.

Comment thread Mathlib/Tactic/Finiteness/Attr.lean Resolved
@adomani

adomani commented Nov 2, 2024

Copy link
Copy Markdown
Contributor

Thanks!

maintainer merge

@github-actions

github-actions Bot commented Nov 2, 2024

Copy link
Copy Markdown

🚀 Pull request has been placed on the maintainer queue by adomani.

@github-actions github-actions Bot added the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Nov 2, 2024

@Vierkantor Vierkantor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks!

bors r+

@ghost ghost added the ready-to-merge This PR has been sent to bors. label Nov 4, 2024
mathlib-bors Bot pushed a commit that referenced this pull request Nov 4, 2024
…it (#18275)

Every file importing Mathlib.Init transitively imports this file already, thus having its module docstring and copyright header checked by the `header` linter. This adds the same input to every file *imported in* Mathlib.Init.

Helps with #17556.
@mathlib-bors

mathlib-bors Bot commented Nov 4, 2024

Copy link
Copy Markdown
Contributor

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors Bot changed the title chore: import the header linter in all files imported in Mathlib.Init [Merged by Bors] - chore: import the header linter in all files imported in Mathlib.Init Nov 4, 2024
@mathlib-bors mathlib-bors Bot closed this Nov 4, 2024
@mathlib-bors
mathlib-bors Bot deleted the MR-import-header-linter branch November 4, 2024 10:42
@grunweg

grunweg commented Nov 4, 2024

Copy link
Copy Markdown
Contributor Author

Thanks for the reviews!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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. ready-to-merge This PR has been sent to bors. t-linter Linter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants