Skip to content

[Merged by Bors] - feat: rewrite the linter for spaces before semicolons in Lean - #16532

Closed
grunweg wants to merge 28 commits into
masterfrom
MR-rewrite-semicolonlinter
Closed

grunweg wants to merge 28 commits into
masterfrom
MR-rewrite-semicolonlinter

Conversation

@grunweg

@grunweg grunweg commented Sep 6, 2024 •

Copy link
Copy Markdown
Contributor

A fix about 30 violations which have crept into mathlib in the mean-time.


Open in Gitpod

grunweg added 15 commits August 30, 2024 23:26
There is an in-progress PR batteries to the same effect: when that PR
lands, this linter can be removed. Both implement basically the same logic.

This linter is consciously not rewritten as a syntax linter, as a fair number
of mathlib contributors have their text editor configured to remove trailing
whitespace when saving: with such configurations, in effect,
the linter would only fire intermittently (such as, between keypresses),
which is not helpful. Running this as a text-based linter in CI,
which is auto-fixable, is far more helpful.
@grunweg grunweg added the t-linter Linter label Sep 6, 2024
@github-actions

github-actions Bot commented Sep 6, 2024 •

Copy link
Copy Markdown

PR summary 4a35d697bc

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

+ semicolonLinter

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.


No changes to technical debt.

You can run this locally as

./scripts/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@mathlib4-dependent-issues-bot mathlib4-dependent-issues-bot added the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Sep 6, 2024
@leanprover-community-bot-assistant leanprover-community-bot-assistant added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Sep 12, 2024
@grunweg
grunweg force-pushed the MR-rewrite-semicolonlinter branch from 930f60f to 2f91482 Compare November 21, 2024 15:54
@grunweg

grunweg commented Nov 21, 2024

Copy link
Copy Markdown
Contributor Author

Actually, this reveals a bug in the suggested auto-fix: while lake exe lint-style respects the linter exclusions, the auto-fix doesn't. Marking as awaiting-author.

@grunweg grunweg added awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. and removed merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) labels Nov 21, 2024
@kim-em

kim-em commented Nov 22, 2024

Copy link
Copy Markdown
Contributor

bors d+

@mathlib-bors

mathlib-bors Bot commented Nov 22, 2024

Copy link
Copy Markdown
Contributor

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

@ghost ghost added delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). and removed awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. labels Nov 22, 2024
@mathlib4-dependent-issues-bot mathlib4-dependent-issues-bot removed the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Nov 22, 2024
@mathlib4-dependent-issues-bot

Copy link
Copy Markdown

This PR/issue depends on:

@leanprover-community-bot-assistant leanprover-community-bot-assistant added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Nov 22, 2024
@joneugster

Copy link
Copy Markdown
Member

I understand the problem now. so, merging this without the fix would mean it will trigger on each future PR?

In that case, I think it would be best to mark this WIP and un-delegate until this bug is fixed.

@joneugster

Copy link
Copy Markdown
Member

an easy hack could be to just use (⟨[' ', ';']⟩ : String) everywhere in the implementation, add a comment, and drop the no-lints

@github-actions github-actions Bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Feb 15, 2025
…ight now.

All known false positives would just trigger on the linter implementation,
where we can avoid it differently.
@grunweg

grunweg commented Feb 15, 2025

Copy link
Copy Markdown
Contributor Author

an easy hack could be to just use (⟨[' ', ';']⟩ : String) everywhere in the implementation, add a comment, and drop the no-lints

Great idea, thanks! I've just done so. If CI comes back green, I will merge the linter.

@grunweg

grunweg commented Feb 16, 2025

Copy link
Copy Markdown
Contributor Author

bors merge

mathlib-bors Bot pushed a commit that referenced this pull request Feb 16, 2025
A fix about 30 violations which have crept into mathlib in the mean-time.



Co-authored-by: Michael Rothgang <[email protected]>
@mathlib-bors

mathlib-bors Bot commented Feb 16, 2025

Copy link
Copy Markdown
Contributor

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors Bot changed the title feat: rewrite the linter for spaces before semicolons in Lean [Merged by Bors] - feat: rewrite the linter for spaces before semicolons in Lean Feb 16, 2025
@mathlib-bors mathlib-bors Bot closed this Feb 16, 2025
@mathlib-bors
mathlib-bors Bot deleted the MR-rewrite-semicolonlinter branch February 16, 2025 09:30
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). t-linter Linter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants