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

feat: check that every file imports Mathlib.Init #18281

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

grunweg
Copy link
Collaborator

@grunweg grunweg commented Oct 27, 2024

We add a text-based check to the lint-style script, that every file either (transivively) imports Mathlib.Init, or is (transitively) imported by it.


Open in Gitpod

This manually adds 'import Mathlib.Init' to all files which are currently missing this.
A future PR will add an automatic check for this.
Stream'.corec' was pre-existing; add it to the exceptions list
@grunweg grunweg added CI Modifies the continuous integration / deployment setup t-linter Linter labels Oct 27, 2024
@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
Copy link

github-actions bot commented Oct 27, 2024

PR summary bebfe32f0e

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

+ checkInitImports

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.

@mathlib4-dependent-issues-bot mathlib4-dependent-issues-bot added the blocked-by-other-PR This PR depends on another PR to Mathlib (this label is automatically managed by a bot) label Oct 27, 2024
@grunweg grunweg requested a review from adomani October 27, 2024 13:34
@bryangingechen
Copy link
Contributor

Right now the module doc of Mathlib.Init says something like "this file is imported by virtually every file in Mathlib". If we add this linter, perhaps we should update that text and also mention that it's enforced by litner.

@grunweg
Copy link
Collaborator Author

grunweg commented Oct 27, 2024

Good point, updated the doc-string!

@mathlib4-dependent-issues-bot mathlib4-dependent-issues-bot removed the blocked-by-other-PR This PR depends on another PR to Mathlib (this label is automatically managed by a bot) label Oct 28, 2024
@github-actions github-actions bot removed the large-import Automatically added label for PRs with a significant increase in transitive imports label Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Modifies the continuous integration / deployment setup t-linter Linter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants