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: lean --error=kind #6362

Merged
merged 1 commit into from
Dec 14, 2024
Merged

feat: lean --error=kind #6362

merged 1 commit into from
Dec 14, 2024

Conversation

tydeu
Copy link
Member

@tydeu tydeu commented Dec 10, 2024

This PR adds the --error=kind option (shorthand: -Ekind) to the lean CLI. When set, messages of kind (e.g., linter.unusedVariables) will be reported as errors. This setting does nothing in interactive contexts (e.g., the server).

Closes #5194.

The spelling --error was chosen instead of the common -Werror both for practical and behavioral reasons. Behaviorally, this option effects not just warnings, but informational messages as well. Practically, -Werror conflicts with the existing -W option for the worker and lean also does not currently use long single-hyphen option names.

@tydeu tydeu added the changelog-language Language features, tactics, and metaprograms label Dec 10, 2024
@github-actions github-actions bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Dec 10, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Dec 10, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Dec 10, 2024
@digama0
Copy link
Collaborator

digama0 commented Dec 10, 2024

Small objection that --error=warning looks like it is making errors act like warnings and not the other way around.

@leanprover-community-bot leanprover-community-bot added the builds-mathlib CI has verified that Mathlib builds against this PR label Dec 10, 2024
@leanprover-community-bot
Copy link
Collaborator

leanprover-community-bot commented Dec 10, 2024

Mathlib CI status (docs):

@tydeu
Copy link
Member Author

tydeu commented Dec 10, 2024

@digama0

Small objection that --error=warning looks like it is making errors act like warnings and not the other way around.

Note the syntax here is --error-linter.unusedVariables. That is, it configures a specific kind to be an error, not a general category / severity (like warning). I should probably add an example to the description (EDIT: done).

@tydeu
Copy link
Member Author

tydeu commented Dec 10, 2024

Separately, this could also use a test but it is not clear to me where in tests directory such a test of the lean CLI itself belong (it does not appear there are any at present). I presently just tested it manually.

@tydeu tydeu marked this pull request as ready for review December 10, 2024 22:21
@tydeu tydeu requested a review from Kha as a code owner December 10, 2024 22:21
@tydeu tydeu added this pull request to the merge queue Dec 11, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 11, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Dec 14, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Dec 14, 2024
@tydeu tydeu added this pull request to the merge queue Dec 14, 2024
Merged via the queue into leanprover:master with commit 280fcc9 Dec 14, 2024
15 checks passed
@tydeu tydeu deleted the error-overrides branch December 14, 2024 02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
builds-mathlib CI has verified that Mathlib builds against this PR changelog-language Language features, tactics, and metaprograms toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RFC: lean -Werror=linter.unusedVariables for MessageData.tagged
4 participants