-
Notifications
You must be signed in to change notification settings - Fork 75
✨ NEW: Add simple typographic replacements #59
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
✨ NEW: Add simple typographic replacements #59
Conversation
Thanks for submitting your first pull request! You are awesome! 🤗 |
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.
Awesome thanks! Just a minor nitpick
# - fractionals 1/2, 1/4, 3/4 -> ½, ¼, ¾ | ||
# - miltiplication 2 x 4 -> 2 × 4 | ||
|
||
RARE_RE = r"\+-|\.\.|\?\?\?\?|!!!!|,,|--" |
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.
RARE_RE = r"\+-|\.\.|\?\?\?\?|!!!!|,,|--" | |
RARE_RE = re.compile(r"\+-|\.\.|\?\?\?\?|!!!!|,,|--") |
It's a bit more performant to pre-compile, then use e.g. RARE_RE.search
# or root check will fail every second time | ||
# SCOPED_ABBR_TEST_RE = r"\((c|tm|r|p)\)" | ||
|
||
SCOPED_ABBR_RE = r"\((c|tm|r|p)\)" |
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.
SCOPED_ABBR_RE = r"\((c|tm|r|p)\)" | |
SCOPED_ABBR_RE = re.compile(r"\((c|tm|r|p)\)", flags=re.IGNORECASE) |
same as above
Also you can just |
""" | ||
import logging | ||
import re | ||
from typing import List |
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.
from typing import List | |
from typing import List, Match |
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.
Thank you.
I was just in trouble. 😄
} | ||
|
||
|
||
def replaceFn(match: re.Match): |
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.
def replaceFn(match: re.Match): | |
def replaceFn(match: Match): |
Codecov Report
@@ Coverage Diff @@
## master #59 +/- ##
==========================================
- Coverage 95.37% 95.31% -0.07%
==========================================
Files 73 74 +1
Lines 3571 3627 +56
==========================================
+ Hits 3406 3457 +51
- Misses 165 170 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
If I add this line to
sphinx warning goes away, is it ok to add it? How can I get rid of the warning? |
yep thats absolutely fine, I don't think there is another "fix" |
I added With python 3.7 there is no warning, but with python 3.6 the warning is still there.
Hmm..., it's going to take some time to fix... 🤔 😕 |
looking good to me 👍 Is it ready for review? |
Should I put together a commit with a rebase? |
yeh weird, it normally has the button here to update the branch if you could rebase then thanks |
I checked "Allow edits by maintainers" My pc env has changed. 😢 I can't rebase, can you handle it for me? 🙏 |
sorted thanks @tsutsu3 😄 |
Issue
#5
Summary
Implemented
replacements (Simple typographic replacements)
rule.Change