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

[Merged by Bors] - chore: a non-lean linter for #-commands #10809

Closed
wants to merge 9 commits into from

Conversation

adomani
Copy link
Collaborator

@adomani adomani commented Feb 21, 2024

This PR introduces an awk-based linter for checking that Mathlib/*.lean files do not contain #-commands.

It takes the names of the commands that begin with # by running

import Mathlib
#help command

and after that it is all text-based substitutions.

It triggers an error on lines that begin with #cmd, omitting (most) lines contained comment blocks.

CI for this PR should fail until #10772 and #10827 have been merged.


#10772 has been merged and the error message for the check decreased.

#10827 has been merged and the error message disappeared.

Open in Gitpod

@adomani adomani added awaiting-review The author would like community review of the PR CI Modifies the continuous integration / deployment setup labels Feb 21, 2024
mathlib-bors bot pushed a commit that referenced this pull request Feb 22, 2024
This PR moves a `#guard_msgs` command from `LinearAlgebra/Matrix/PosDef` to a test file: it is a preparation for #10809.
@semorrison
Copy link
Contributor

Okay, not lovely, but better than nothing! :-)

bors d+

@mathlib-bors
Copy link

mathlib-bors bot commented Feb 22, 2024

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

@github-actions github-actions bot added delegated and removed awaiting-review The author would like community review of the PR labels Feb 22, 2024
@adomani
Copy link
Collaborator Author

adomani commented Feb 22, 2024

Thanks for the approval and for merging the remaining "test" PR.

I hope that this is just a temporary fix.

I'm trying to see how actual Lean linters work and hopefully I'll be able to replace this one by a proper linter.

@adomani
Copy link
Collaborator Author

adomani commented Feb 22, 2024

bors r+

mathlib-bors bot pushed a commit that referenced this pull request Feb 22, 2024
This PR introduces an `awk`-based linter for checking that `Mathlib/*.lean` files do not contain `#`-commands.

It takes the names of the commands that begin with `#` by running
```lean
import Mathlib
#help command
```
and after that it is all text-based substitutions.

It triggers an error on lines that begin with `#cmd`, omitting (most) lines contained comment blocks.

CI for this PR should fail until #10772 and #10827 have been merged.
@mathlib-bors
Copy link

mathlib-bors bot commented Feb 22, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title chore: a non-lean linter for #-commands [Merged by Bors] - chore: a non-lean linter for #-commands Feb 22, 2024
@mathlib-bors mathlib-bors bot closed this Feb 22, 2024
@mathlib-bors mathlib-bors bot deleted the adomani/hash_commands branch February 22, 2024 04:38
thorimur pushed a commit that referenced this pull request Feb 24, 2024
This PR moves a `#guard_msgs` command from `LinearAlgebra/Matrix/PosDef` to a test file: it is a preparation for #10809.
thorimur pushed a commit that referenced this pull request Feb 24, 2024
This PR introduces an `awk`-based linter for checking that `Mathlib/*.lean` files do not contain `#`-commands.

It takes the names of the commands that begin with `#` by running
```lean
import Mathlib
#help command
```
and after that it is all text-based substitutions.

It triggers an error on lines that begin with `#cmd`, omitting (most) lines contained comment blocks.

CI for this PR should fail until #10772 and #10827 have been merged.
@alexjbest
Copy link
Member

I think this would have been better to add as an extra linter for the style linter python script. In the same way as we ban set option there. This would be a much less complicated way of doing things imo, and we would get things like reviewdog for free almost

thorimur pushed a commit that referenced this pull request Feb 26, 2024
This PR moves a `#guard_msgs` command from `LinearAlgebra/Matrix/PosDef` to a test file: it is a preparation for #10809.
thorimur pushed a commit that referenced this pull request Feb 26, 2024
This PR introduces an `awk`-based linter for checking that `Mathlib/*.lean` files do not contain `#`-commands.

It takes the names of the commands that begin with `#` by running
```lean
import Mathlib
#help command
```
and after that it is all text-based substitutions.

It triggers an error on lines that begin with `#cmd`, omitting (most) lines contained comment blocks.

CI for this PR should fail until #10772 and #10827 have been merged.
adomani added a commit that referenced this pull request Feb 27, 2024
This PR moves a `#guard_msgs` command from `LinearAlgebra/Matrix/PosDef` to a test file: it is a preparation for #10809.
@adomani
Copy link
Collaborator Author

adomani commented Feb 27, 2024

@alexjbest in case you are curious, I have a draft version of the same linter, but written in lean as a "syntax linter": #11019.

If that one is preferred, then I am happy to remove this one!

riccardobrasca pushed a commit that referenced this pull request Mar 1, 2024
This PR moves a `#guard_msgs` command from `LinearAlgebra/Matrix/PosDef` to a test file: it is a preparation for #10809.
riccardobrasca pushed a commit that referenced this pull request Mar 1, 2024
This PR introduces an `awk`-based linter for checking that `Mathlib/*.lean` files do not contain `#`-commands.

It takes the names of the commands that begin with `#` by running
```lean
import Mathlib
#help command
```
and after that it is all text-based substitutions.

It triggers an error on lines that begin with `#cmd`, omitting (most) lines contained comment blocks.

CI for this PR should fail until #10772 and #10827 have been merged.
dagurtomas pushed a commit that referenced this pull request Mar 22, 2024
This PR moves a `#guard_msgs` command from `LinearAlgebra/Matrix/PosDef` to a test file: it is a preparation for #10809.
dagurtomas pushed a commit that referenced this pull request Mar 22, 2024
This PR introduces an `awk`-based linter for checking that `Mathlib/*.lean` files do not contain `#`-commands.

It takes the names of the commands that begin with `#` by running
```lean
import Mathlib
#help command
```
and after that it is all text-based substitutions.

It triggers an error on lines that begin with `#cmd`, omitting (most) lines contained comment blocks.

CI for this PR should fail until #10772 and #10827 have been merged.
Louddy pushed a commit that referenced this pull request Apr 15, 2024
This PR moves a `#guard_msgs` command from `LinearAlgebra/Matrix/PosDef` to a test file: it is a preparation for #10809.
Louddy pushed a commit that referenced this pull request Apr 15, 2024
This PR introduces an `awk`-based linter for checking that `Mathlib/*.lean` files do not contain `#`-commands.

It takes the names of the commands that begin with `#` by running
```lean
import Mathlib
#help command
```
and after that it is all text-based substitutions.

It triggers an error on lines that begin with `#cmd`, omitting (most) lines contained comment blocks.

CI for this PR should fail until #10772 and #10827 have been merged.
mathlib-bors bot pushed a commit that referenced this pull request May 24, 2024
A Lean-linter implementation of the `#`-command linter introduced in #10809.

This linter produces a warning whenever a non-allowed `#`-command is used.  The allowed commands are
```lean
#align
#align_import
#noalign
#adaptation_note
```

[Zulip discussion](https://leanprover.zulipchat.com/#narrow/stream/144837-PR-reviews/topic/.2311019.3A.20a.20syntax.20linter.20for.20.23-commands)



Co-authored-by: Michael Rothgang <rothgami@math.hu-berlin.de>
grunweg added a commit that referenced this pull request May 24, 2024
A Lean-linter implementation of the `#`-command linter introduced in #10809.

This linter produces a warning whenever a non-allowed `#`-command is used.  The allowed commands are
```lean
#align
#align_import
#noalign
#adaptation_note
```

[Zulip discussion](https://leanprover.zulipchat.com/#narrow/stream/144837-PR-reviews/topic/.2311019.3A.20a.20syntax.20linter.20for.20.23-commands)



Co-authored-by: Michael Rothgang <rothgami@math.hu-berlin.de>
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 delegated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants