[Merged by Bors] - feat: add endOf linter#14378
Conversation
PR summary b600a781ceImport changes for modified filesNo significant changes to the import graph Import changes for all files
Declarations diff
You can run this locally as follows## summary with just the declaration names:
./scripts/no_lost_declarations.sh short <optional_commit>
## more verbose report:
./scripts/no_lost_declarations.sh <optional_commit> |
…_allow_noncomputable
…_allow_noncomputable
…_allow_noncomputable
…_allow_noncomputable
grunweg
left a comment
There was a problem hiding this comment.
Thanks for writing this linter! Looks very nice overall --- I have some suggestions for polish, code clarity etc.
I pushed those directly: if you disagree with any or have further suggestions, I'm very interested in your opinion. Notably, I have tweaked the linter error message; your script will need adaptation.
I have not reviewed the automatic fixes yet, will do so next.
- What do you think about adding a test?
- I'm not sold on the name "EndOf" yet: what do you think about "openSectionsNamespaces", "unclosedSectionsNamespaces" or perhaps "unclosedScopes"?
grunweg
left a comment
There was a problem hiding this comment.
I've gone through all the automatic changes now. Obviously, they are all correct (in the sense that they compile and pass the linter). A few times, they expose pre-existing weirdness; I'd prefer to fix that instead. (This could be a pre-requisite PR which I can approve quickly.)
| · simp only [Set.mem_setOf_eq, Walk.start_mem_support, exists_true_left] | ||
| refine ⟨hw, Walk.connected_induce_support _ _ _⟩ | ||
|
|
||
| end induced_subgraphs |
There was a problem hiding this comment.
Pre-existing: do we have a policy that section names should be CamelCase or match their declarations?
|
|
||
| end Positivity | ||
|
|
||
| end Meta |
There was a problem hiding this comment.
Also pre-existing: tactics are sometimes in the Meta and sometimes in the Tactic namespaces: is there an intentional difference? (Presumably also out of scope of this PR.)
|
|
||
| end | ||
|
|
||
| end Testing |
There was a problem hiding this comment.
This namespace is inconsistent with the other tests -> rename to Tests instead?
|
#14620 contains a few of these fixes. |
|
The fixes to the other files have landed; I have merged master. This PR now just contains the linter. |
|
🚀 Pull request has been placed on the maintainer queue by grunweg. |
This linter emits a warning at the end of a file if there are unclosed `namespace`s or `section`s. All missing `end`s have been added (automatically) in #14621. Unlike #14352, this PR does leaves outermost `noncomputable section`s open. [Zulip thread](https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/linting.20for.20unclosed.20sections.3F) Co-authored-by: Michael Rothgang <rothgami@math.hu-berlin.de> Co-authored-by: grunweg <rothgami@math.hu-berlin.de>
|
Build failed (retrying...): |
This linter emits a warning at the end of a file if there are unclosed `namespace`s or `section`s. All missing `end`s have been added (automatically) in #14621. Unlike #14352, this PR does leaves outermost `noncomputable section`s open. [Zulip thread](https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/linting.20for.20unclosed.20sections.3F) Co-authored-by: Michael Rothgang <rothgami@math.hu-berlin.de> Co-authored-by: grunweg <rothgami@math.hu-berlin.de>
|
Build failed (retrying...): |
|
bors r- |
|
Canceled. |
|
Wronskian violates the linter and just got in |
|
bors delegate+ Please merge again when fixed |
|
✌️ adomani can now approve this pull request. To approve and merge a pull request, simply reply with |
…_allow_noncomputable
|
bors r+ |
This linter emits a warning at the end of a file if there are unclosed `namespace`s or `section`s. All missing `end`s have been added (automatically) in #14621. Unlike #14352, this PR does leaves outermost `noncomputable section`s open. [Zulip thread](https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/linting.20for.20unclosed.20sections.3F) Co-authored-by: Michael Rothgang <rothgami@math.hu-berlin.de> Co-authored-by: grunweg <rothgami@math.hu-berlin.de>
|
Pull request successfully merged into master. Build succeeded: |
endOf linterendOf linter
This linter emits a warning at the end of a file if there are unclosed
namespaces orsections.All missing
ends have been added (automatically) in #14621.Unlike #14352, this PR does leaves outermost
noncomputable sections open.Zulip thread
Self-correcting script: