-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add bytes to unicode converters #70
Conversation
b212f27
to
b48822c
Compare
https://github.com/src-d/lookout-sdk-ml/pull/70/files#r266958347 check all unresolved conversation to see all minor issues left |
b995294
to
1e7108f
Compare
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.
A bit of renaming and docstring improving in the decorators is left. I edited the first one as an example.
lookout/core/data_requests.py
Outdated
changes = request_changes( | ||
data_service.get_data(), ptr_from, ptr_to, contents=False, uast=True) | ||
return func(self, ptr_from, ptr_to, data_service, changes=changes, **data) | ||
def wrapped_with_changed_uasts_(func): |
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 wrapped_with_changed_uasts_(func): | |
def configured_with_changed_uasts(func): |
lookout/core/data_requests.py
Outdated
""" | ||
Decorator to provide "changes" keyword argument to `**data` in `Analyzer.analyze()`. | ||
|
||
"changes" contain the list of `Change` - see lookout/core/server/sdk/service_data.proto. | ||
The changes will have only UASTs, no raw file contents. | ||
Decorated method should have the signature compatible with `Analyzer.analyze()`. |
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.
Decorated method should have the signature compatible with `Analyzer.analyze()`. | |
Decorated method should have a signature compatible with `Analyzer.analyze()`. |
lookout/core/data_requests.py
Outdated
|
||
:param func: Method with the signature compatible with `Analyzer.analyze()`. | ||
:param unicode: Set to True if content and UAST should be converted to unicode format. \ |
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.
:param unicode: Set to True if content and UAST should be converted to unicode format. \ | |
:param unicode: Value indicating whether `content` and UAST positions should be converted to Unicode. \ |
Signed-off-by: Konstantin Slavnov <[email protected]>
Related to src-d/style-analyzer#666
To use v2 drivers for javascript it is required to add
UnicodeDataService
andBytesToUnicodeConverter
classes.