-
Notifications
You must be signed in to change notification settings - Fork 366
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: the unusedVariableCommand linter #17715
Draft
adomani
wants to merge
274
commits into
master
Choose a base branch
from
adomani/unused_variable_only
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…able_command_linter
…eanprover-community/mathlib4 into adomani/unused_variable_command_linter
…eanprover-community/mathlib4 into adomani/unused_variable_command_linter
…able_command_linter
…able_command_linter
…eanprover-community/mathlib4 into adomani/unused_variable_command_linter
…able_command_linter
Jun2M
pushed a commit
that referenced
this pull request
Nov 17, 2024
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 18, 2024
TobiasLeichtfried
pushed a commit
that referenced
this pull request
Nov 21, 2024
TobiasLeichtfried
pushed a commit
that referenced
this pull request
Nov 21, 2024
TobiasLeichtfried
pushed a commit
that referenced
this pull request
Nov 21, 2024
leanprover-community-bot-assistant
removed
the
merge-conflict
The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot)
label
Nov 23, 2024
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 25, 2024
Adding this for reference: I presume the new async linting also confuses the linter, so would have to be turned off as well, right? See #20755 for reference. |
leanprover-community-bot-assistant
removed
the
merge-conflict
The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot)
label
Jan 16, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
large-import
Automatically added label for PRs with a significant increase in transitive imports
t-linter
Linter
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is still work-in-progress, but also help-wanted!
The linter reliably flags unused variables: so far, only
example
s fool it (and that is simply because I did not implement a fix, as there are very fewvariable
s that are only used inexample
s in mathlib).The work-in-progress part refers to the fact that the linter uses an
IO.Ref
to keep track of variables and this does not work well with editing the file. The linter works on a fresh parse of a file, but becomes out-of-sync with every edit.The help-wanted is to ask for help to make mathlib compliant with the linter, by checking out this branch and PR-ing a few variable removals!
Zulip discussion
Known issues:
automatic namespacing and
nonrec
may cause difficulty when the newly introduced declaration is preferred in the term, rather than the original one (see examples herewhere, for instance,
ContinuousOn.arsinh
is used internally instead ofReal.arsinh
).mutual
declarations confuse the lintercode -r -g Mathlib/CategoryTheory/EffectiveEpi/Comp.lean:133:29
universe annotations confuse the linter:
inductive
s confusing the linterdef
s confusing the linterspecial typeclass assumptions
not sure what is going on here: