[Merged by Bors] - feat: unrestricted character set in unicode linter#39796
[Merged by Bors] - feat: unrestricted character set in unicode linter#39796thorimur wants to merge 7 commits into
unrestricted character set in unicode linter#39796Conversation
maybeEmojis and ⚠️ in unicode lintermaybeEmojis in unicode linter
PR summary 5f7a90dd94Import changes for modified filesNo significant changes to the import graph Import changes for all files
|
|
Thanks for the fix! Can you update the PR description to say what |
|
The current status is that |
I was uncertain about this, thanks for bringing it up. :) The issue is that neither the keyboard shortcut |
|
Let's also ask our expert on Unicode variant selectors @joneugster |
|
Sounds good, let's wait for him. :) I'll also mention this zulip thread I started in case we want further discussion on this specific issue, as well as the zulip thread mentioned in the RFC for convenience. |
joneugster
left a comment
There was a problem hiding this comment.
Looks reasonable to lift restrictions on certain characters, thanks!
| ] | ||
|
|
||
| /-- Unicode symbols in mathlib that have no restrictions on which selector they are followed by. -/ | ||
| public def maybeEmojis : Array Char := #[ |
There was a problem hiding this comment.
so these are allowed to have either variant-selector (text/emoji) or none at all, aren't they?
maybe there is a better name for it? somehow the name suggests to me that it must have a selector, but it's optional which one.
Docstring might need to reflect that "no selector" is allowed, too.
There was a problem hiding this comment.
Hmm, maybe unrestricted or unrestrictedChars?
There was a problem hiding this comment.
I've tried out unrestricted (and moved it down below, since now it's not emoji-related per se), let me know what you think :)
maybeEmojis in unicode linterunrestricted character set in unicode linter
Variant selector do make it easier to display emojis correctly. However, adding them might potentially also bring other issues and might not be worth the time for lean4 core. Especially, what lean4 does is outside our reach (as mathlib contributors) and we should work with what we get from core. |
joneugster
left a comment
There was a problem hiding this comment.
There is a test file which tests that emojis and non-emojis have an empty intersection. Could you add two more tests ensuring this for the new unrestricted
joneugster
left a comment
There was a problem hiding this comment.
Thanks!
maintainer merge
|
Hmm, weird that maintainer merge did not apply the label here...maybe because github identified a merge conflict when it was applied? MathlibTest/LintStyle.lean was renamed to MathlibTest/TextBased.lean, and github said I must resolve these changes. Though, |
|
Let me merge this PR, then the above issue is moot :-) |
This PR creates the `unrestricted` array in the unicode linter, which contains characters that have no restrictions on which selector they are followed by, and are not enforced to be followed by any selector at all. We include `'⚠'` in it to allow `⚠️ `. We don't want to ban the text version (`⚠`), as this is used in lake output (without the text selector) and so may conceivably be mentioned in a comment. We plan to use `⚠️ ` in #38126.
|
Pull request successfully merged into master. Build succeeded: |
unrestricted character set in unicode linterunrestricted character set in unicode linter
…unity#39796) This PR creates the `unrestricted` array in the unicode linter, which contains characters that have no restrictions on which selector they are followed by, and are not enforced to be followed by any selector at all. We include `'⚠'` in it to allow `⚠️ `. We don't want to ban the text version (`⚠`), as this is used in lake output (without the text selector) and so may conceivably be mentioned in a comment. We plan to use `⚠️ ` in leanprover-community#38126.
…unity#39796) This PR creates the `unrestricted` array in the unicode linter, which contains characters that have no restrictions on which selector they are followed by, and are not enforced to be followed by any selector at all. We include `'⚠'` in it to allow `⚠️ `. We don't want to ban the text version (`⚠`), as this is used in lake output (without the text selector) and so may conceivably be mentioned in a comment. We plan to use `⚠️ ` in leanprover-community#38126.
This PR creates the
unrestrictedarray in the unicode linter, which contains characters that have no restrictions on which selector they are followed by, and are not enforced to be followed by any selector at all.We include
'⚠'in it to allow⚠️. We don't want to ban the text version (⚠), as this is used in lake output (without the text selector) and so may conceivably be mentioned in a comment.We plan to use
⚠️in #38126.