-
Notifications
You must be signed in to change notification settings - Fork 373
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: linter for bare open (scoped) Classical
#21947
base: master
Are you sure you want to change the base?
Conversation
PR summary d0a98c7d58Import changes for modified filesNo significant changes to the import graph Import changes for all files
|
/-- If `stx` is syntax describing an `open` command, `extractOpenNames stx` | ||
returns an array of the syntax corresponding to the opened names, | ||
omitting any renamed or hidden items. -/ | ||
def extractOpenNames : Syntax → Array Syntax |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remember this function already existing, but I cannot find it. Do you know if it already exists and if maybe it can be recycled?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't remember seeing it, but have asked on zulip
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Status update: nobody responded on zulip --- perhaps it doesn't exist yet.
Please update the PR description at some point 😉 |
@adomani Do you have an idea why the tests fail? They don't seem to register the new lint at all. I'm honest at a loss as to why this occurs. |
I think that there is a hardcoded |
Co-authored-by: damiano <[email protected]>
… options, this is not necessary any more.
🤦 Oh wow, thanks for pointing out the tomatoes on my eyes! Upon a closer look, I decided to remove those exclusions wholesale: downstream projects can decide to activate the linter in their lakefile. |
Add a syntax linter for
open Classical
andopen scoped Classical
which are not scoped to a single declaration.Such occurrences have been tracked as technical debt, and recently been fully removed from mathlib.
This linter enforces this (and removes the corresponding technical debt metric).
TODO: does the function for finding
open
s already exist elsewhere?Second version of #15454.