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

Add bytes to unicode converters #70

Merged
merged 1 commit into from
Mar 20, 2019
Merged

Conversation

zurk
Copy link
Contributor

@zurk zurk commented Mar 11, 2019

Related to src-d/style-analyzer#666

To use v2 drivers for javascript it is required to add UnicodeDataService and BytesToUnicodeConverter classes.

@zurk zurk requested a review from vmarkovtsev March 11, 2019 17:58
@zurk zurk force-pushed the bytes_to_str branch 2 times, most recently from b212f27 to b48822c Compare March 13, 2019 09:20
@zurk
Copy link
Contributor Author

zurk commented Mar 19, 2019

https://github.com/src-d/lookout-sdk-ml/pull/70/files#r266958347
and tests major things are left.

check all unresolved conversation to see all minor issues left

@zurk zurk force-pushed the bytes_to_str branch 3 times, most recently from b995294 to 1e7108f Compare March 20, 2019 11:00
Copy link
Collaborator

@vmarkovtsev vmarkovtsev left a 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.

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):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
def wrapped_with_changed_uasts_(func):
def configured_with_changed_uasts(func):

"""
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()`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Decorated method should have the signature compatible with `Analyzer.analyze()`.
Decorated method should have a signature compatible with `Analyzer.analyze()`.


: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. \
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
: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]>
@vmarkovtsev vmarkovtsev merged commit 212407c into src-d:master Mar 20, 2019
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.

2 participants