Skip to content

feat: the endOf linter#14352

Closed
adomani wants to merge 14 commits intomasterfrom
adomani/endOfLinter
Closed

feat: the endOf linter#14352
adomani wants to merge 14 commits intomasterfrom
adomani/endOfLinter

Conversation

@adomani
Copy link
Copy Markdown
Contributor

@adomani adomani commented Jul 2, 2024

This linter emits a warning at the end of a file if there are unclosed namespaces or sections.

Even though the current form of the linter allows the outermost noncomputable section to be left open, the adaptations to the files were done before this change. This means that several files have been modified just to add the missing end to a noncomputable section ... end pair.

See #14378 for the same linter, but run on a fresh copy of master with "minimal" modifications to mathlib.

Zulip thread


The addition of the end was done by

eval "$(
lake build |
  awk -F"'" -v ti="'" '
    /^warning/ {
      fil=$1
      gsub(/^.*\.\//, "", fil)
      gsub(/:.*/, "", fil)
      printf("printf %s\\n%s\\n%s >> %s\n", ti, $(NF-1), ti, fil)
    }'
)"

Open in Gitpod

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jul 2, 2024

PR summary 99fa7cda24

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

+ endOfLinter
+ getLinterHash

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>

@ghost ghost added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jul 3, 2024
@ghost ghost removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jul 3, 2024
@ghost ghost added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jul 3, 2024
@ghost ghost removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jul 3, 2024
@adomani
Copy link
Copy Markdown
Contributor Author

adomani commented Jul 3, 2024

Closing in favour of #14378.

@adomani adomani closed this Jul 3, 2024
mathlib-bors bot pushed a commit that referenced this pull request Jul 11, 2024
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>
mathlib-bors bot pushed a commit that referenced this pull request Jul 11, 2024
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>
mathlib-bors bot pushed a commit that referenced this pull request Jul 11, 2024
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>
@YaelDillies YaelDillies deleted the adomani/endOfLinter branch August 15, 2025 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-linter Linter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants