-
Notifications
You must be signed in to change notification settings - Fork 369
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(Tactic/Linter): add unicode linter for unicode variant-selectors #17129
Open
joneugster
wants to merge
66
commits into
master
Choose a base branch
from
eugster/unicode-linter
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.
+242
−14
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
Co-authored-by: grunweg <[email protected]>
Also fix some comments
Using whitelist to ignore characters, using further lists to check emoji/text variant selector use
The effect depends on the font that is used.
PR summary b9c6d10e3aImport changes exceeding 2%
Import changes for modified filesNo significant changes to the import graph Import changes for all files
|
4 tasks
bot fix style |
1 task
adomani
reviewed
Sep 25, 2024
Co-authored-by: damiano <[email protected]>
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.
Unicode characters can be followed by one of the two "variant-selectors"
\FE0E
(text) or\FE0F
(emoji).These appear to the user as a single unicode character and they might copy them by accident. For example
✅️
(\u2705\uFE0F
),✅
(\u2705
) and✅︎
(\u2705\uFE0E
) are three variants of the "same" unicode character. The one without variant-selector might display as either emoji or not, depending on the user's device and font.Add unicode linter ensuring variant-selector only appear on specified characters and also ensuring these characters always have the correct variant selector to avoid confusions.
Everything flagged by this linter can be fixed fully automatically with
lake exe lint-style --fix
or by commentingbot fix style
on the PR.This is the first PR of a series of PRs about unicode characters in Mathlib. The second PR will be addressing non-breaking spaces.
Zulip discussions:
Generally, the discussions seemed to show favour for the first two PRs in this series (handling variant selectors & dealing with invisible chars. such as
(\u00A0
)) while there seems to be still room for discussion about what to do with general unicode characters (whitelist, blacklist, ...)Related PRs:
Lean
itself.