Skip to content
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

Stopped autocapitalisation of backslash preceded keywords #175

Merged
merged 1 commit into from
Feb 23, 2017

Conversation

autophagy
Copy link
Contributor

@autophagy autophagy commented Feb 23, 2017

No description provided.

@codecov-io
Copy link

codecov-io commented Feb 23, 2017

Codecov Report

Merging #175 into master will increase coverage by 0.06%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master     #175      +/-   ##
==========================================
+ Coverage   81.11%   81.17%   +0.06%     
==========================================
  Files          16       16              
  Lines        1859     1865       +6     
==========================================
+ Hits         1508     1514       +6     
  Misses        351      351
Impacted Files Coverage Δ
src/crate/crash/repl.py 52.3% <100%> (+0.74%)
src/crate/crash/test_repl.py 100% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 980778c...fd4334c. Read the comment docs.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) to 81.267% when pulling 41767f8 on mika/keywordsBackslash into 980778c on master.

1 similar comment
@coveralls
Copy link

coveralls commented Feb 23, 2017

Coverage Status

Coverage increased (+0.04%) to 81.267% when pulling 41767f8 on mika/keywordsBackslash into 980778c on master.

@@ -222,7 +222,7 @@ def is_multiline():

class Capitalizer:

KEYWORD_RE = r'(?:"\w+)|(?:\'\w+)|\w+'
KEYWORD_RE = r'(?:"\w+)|(?:\'\w+)|(?:\\\w+)|\w+'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this does not catch the case \format dynamic

You need to disable auto-captialisation when line starts with \

@@ -83,6 +83,10 @@ def test_capitalize(self):
self.capitalizer(buffer)
self.assertEqual(u'CREATE TABLE test\n(a BOOLEAN, b STRING, c INTEGER)', buffer.text)

text = u'\select'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

text = u'\format dynamic'

@autophagy autophagy changed the title Mika/keywords backslash Added missing SQL Keywords and stopped autocapitalisation of backslash preceded keywords Feb 23, 2017
@autophagy autophagy removed the request for review from memcmp February 23, 2017 13:24
if self.last_changed and self.is_prefix(current_line[:cursor_position].lower(), self.last_changed.lower()):
diff = len(self.last_changed) - len(current_line)
current_line = self.last_changed + current_line[diff:]
if current_line[0] != '\\':
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code style: make as little indentation (nested if blocks) as possible

if current_line.startswith('\\'):
    return

then you can leave the indentation of the rest as is

@coveralls
Copy link

coveralls commented Feb 23, 2017

Coverage Status

Coverage increased (+0.05%) to 81.277% when pulling a1fbf8a on mika/keywordsBackslash into 980778c on master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.05%) to 81.277% when pulling a1fbf8a on mika/keywordsBackslash into 980778c on master.

@coveralls
Copy link

coveralls commented Feb 23, 2017

Coverage Status

Coverage increased (+0.06%) to 81.287% when pulling f5b8ff3 on mika/keywordsBackslash into 980778c on master.

1 similar comment
@coveralls
Copy link

coveralls commented Feb 23, 2017

Coverage Status

Coverage increased (+0.06%) to 81.287% when pulling f5b8ff3 on mika/keywordsBackslash into 980778c on master.

@coveralls
Copy link

coveralls commented Feb 23, 2017

Coverage Status

Coverage increased (+0.06%) to 81.287% when pulling f5b8ff3 on mika/keywordsBackslash into 980778c on master.

@autophagy autophagy changed the title Added missing SQL Keywords and stopped autocapitalisation of backslash preceded keywords Stopped autocapitalisation of backslash preceded keywords Feb 23, 2017
@coveralls
Copy link

coveralls commented Feb 23, 2017

Coverage Status

Coverage increased (+0.06%) to 81.287% when pulling fd4334c on mika/keywordsBackslash into 980778c on master.

@autophagy autophagy merged commit fd4334c into master Feb 23, 2017
@autophagy autophagy deleted the mika/keywordsBackslash branch February 23, 2017 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants