mathlib4
mathlib4 copied to clipboard
feat: lint `attribute [instance] instName in`
Contrary to what users would expect, this defines a global instance.
This linter would have caught #13144 and #13170. Zulip discussion
Co-authored by: @adomani
I wrote a test yesterday (of course!), but forgot to commit it :facepalm: I've updated it to use your example instance now (and added you as an author of the tests), since this avoid mathlib imports.
I just tried the logic you proposed. It works, so I switched to it (and added you an an author).
I tweaked one test to consider nested syntax (which worked), so I guess attributes are always the first syntax.
!bench
Here are the benchmark results for commit 627bf3ad22c5bc22738e391fcc2e8f85ff6dfc8d. There were no significant changes against commit 49e1c29de1b78922c62e6e0cd04280bc742897f6.
Two minor requests, otherwise
bors d+
:v: 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.
Thanks for the fast review. bors r+
bors r+
Pull request successfully merged into master.
Build succeeded:
@grunweg Future idea for this linter: Catch #7678 as well.