-
Notifications
You must be signed in to change notification settings - Fork 471
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
C escapes #174
C escapes #174
Conversation
A new command line option --c-esacpes is implemented which treats files as if they contain C-style character escapes. So for example "\nHello" is parsed as "hello" instead of "nhello".
Codecov Report
@@ Coverage Diff @@
## master #174 +/- ##
==========================================
+ Coverage 87.81% 88.41% +0.59%
==========================================
Files 2 3 +1
Lines 665 656 -9
Branches 93 94 +1
==========================================
- Hits 584 580 -4
+ Misses 62 58 -4
+ Partials 19 18 -1
Continue to review full report at Codecov.
|
I like the idea. |
action='store_true', default=False, | ||
help='Treats files as if they contain C-style character ' | ||
'escapes. So for example "\\nHello" is parsed as ' | ||
'"hello" instead of "nhallo".') |
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.
nhallo -> nhello
also \\nHello
-> \\nhello
or capitalize the other two
And maybe r"\nhello"
is clearer than "\\nhello"
?
@@ -40,6 +40,7 @@ | |||
quiet_level = 0 | |||
encodings = ['utf-8', 'iso-8859-1'] | |||
word_regex = re.compile(r"[\w\-']+") | |||
c_escape_regex = re.compile(r'\\\w') |
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.
Would it be better to use the standard set of escape sequences?
@@ -256,6 +256,15 @@ def test_check_filename(): | |||
assert_equal(cs.main('-f', d), 1) | |||
|
|||
|
|||
def test_c_escapes(): | |||
"""Test c-esacpes option""" |
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.
Meta spelling error, it should be c-escapes! 😄
ping @thdot — any progress? If not, we can close this PR. |
A new command line option
--c-esacpes
is implemented which treats files as if they contain C-style character escapes. So for example "\nHello" is parsed as "hello" instead of "nhello".What do you think?