[Merged by Bors] - feat: lint against stream-of-conciousness obtain syntax#13220
[Merged by Bors] - feat: lint against stream-of-conciousness obtain syntax#13220
Conversation
Also, move to the Linter directory and add to Tactic.Basic. Now, let CI do the work.
Rename the linter from "bad" to "old"; make the error more polite".
… just import Lean and Batteries there.
|
Also linted against the analogous |
|
May I make you remark that this is really not a |
|
I would argue it's a feature in the "linters" category - but I'm also happy to change the title. Let me know if you prefer a different category. |
5d64b96 to
1957f58
Compare
|
Maybe ask the question on Zulip |
PR summary 6751058336Import changesDependency changes
|
YaelDillies
left a comment
There was a problem hiding this comment.
So that it displays well in the docs...
Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
|
Thanks for the tweaks (just applied them)! In markdown, the previous formatting looked fine to me - but I'll trust your judgement that the generated docs look better this way! |
|
Once Bryan updates the Observable notebook, we will be able to preview docs again. For now, I believe this is fine. maintainer merge |
|
🚀 Pull request has been placed on the maintainer queue by YaelDillies. |
|
Thanks for writing this syntax linter! bors merge |
Just the syntax replacements are split into #13219. Most of its occurrences were removed in #11045 and #12850; #13219 removed the last instances. **Why is this removed?** In a nutshell, my understanding is that this is preferred against for similar reasons as #10534: - it's a Lean3-ism, which can be unlearned now - the syntax `obtain foo : type := proof` is slightly shorter; particularly so when the next tactic is `exact` - when using it as `obtain foo : type; · proof`, there is an intermediate state with multiple goals right before the focusing dot (This gets amplified with the in-flight "multiple goal linter", which in my perception seems generally desired - for many reasons, including teachability. Granted, the linter could be tweaked to not lint in this case... but by now, the "old" syntax is not clearly better.) - the old syntax *could* be slightly nicer when deferring goals: In the 30 replacements of the last PR, this occurred *twice* (i.e., very rarely). In both cases, `suffices` or `rsuffices` can be used, and would imho be clearer. Alternatively, the `obtain` tactic in Lean core could also be changed: this change does not block this at all, but moves forward with something that is doable within mathlib today.
|
Pull request successfully merged into master. Build succeeded: |
|
Thank you for reviewing it! |
Just the syntax replacements are split into #13219. Most of its occurrences were removed in #11045 and #12850; #13219 removed the last instances. **Why is this removed?** In a nutshell, my understanding is that this is preferred against for similar reasons as #10534: - it's a Lean3-ism, which can be unlearned now - the syntax `obtain foo : type := proof` is slightly shorter; particularly so when the next tactic is `exact` - when using it as `obtain foo : type; · proof`, there is an intermediate state with multiple goals right before the focusing dot (This gets amplified with the in-flight "multiple goal linter", which in my perception seems generally desired - for many reasons, including teachability. Granted, the linter could be tweaked to not lint in this case... but by now, the "old" syntax is not clearly better.) - the old syntax *could* be slightly nicer when deferring goals: In the 30 replacements of the last PR, this occurred *twice* (i.e., very rarely). In both cases, `suffices` or `rsuffices` can be used, and would imho be clearer. Alternatively, the `obtain` tactic in Lean core could also be changed: this change does not block this at all, but moves forward with something that is doable within mathlib today.
Just the syntax replacements are split into #13219. Most of its occurrences were removed in #11045 and #12850; #13219 removed the last instances. **Why is this removed?** In a nutshell, my understanding is that this is preferred against for similar reasons as #10534: - it's a Lean3-ism, which can be unlearned now - the syntax `obtain foo : type := proof` is slightly shorter; particularly so when the next tactic is `exact` - when using it as `obtain foo : type; · proof`, there is an intermediate state with multiple goals right before the focusing dot (This gets amplified with the in-flight "multiple goal linter", which in my perception seems generally desired - for many reasons, including teachability. Granted, the linter could be tweaked to not lint in this case... but by now, the "old" syntax is not clearly better.) - the old syntax *could* be slightly nicer when deferring goals: In the 30 replacements of the last PR, this occurred *twice* (i.e., very rarely). In both cases, `suffices` or `rsuffices` can be used, and would imho be clearer. Alternatively, the `obtain` tactic in Lean core could also be changed: this change does not block this at all, but moves forward with something that is doable within mathlib today.
Just the syntax replacements are split into #13219.
Most of its occurrences were removed in #11045 and #12850; #13219 removed the last instances.
Why is this removed? In a nutshell, my understanding is that this is preferred against for similar reasons as #10534:
obtain foo : type := proofis slightly shorter; particularly so when the next tactic isexactobtain foo : type; · proof, there is an intermediate state with multiple goals right before the focusing dot(This gets amplified with the in-flight "multiple goal linter", which in my perception seems generally desired - for many reasons, including teachability. Granted, the linter could be tweaked to not lint in this case... but by now, the "old" syntax is not clearly better.)
sufficesorrsufficescan be used, and would imho be clearer.Alternatively, the
obtaintactic in Lean core could also be changed: this change does not block this at all,but moves forward with something that is doable within mathlib today.