{"action":"created","comment":{"url":"https://api.github.com/repos/src-d/lookout-sdk/pulls/comments/214633766","pull_request_review_id":151727455,"id":214633766,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNDYzMzc2Ng==","diff_hunk":"@@ -1 +1,99 @@\n-# lookout-sdk\n\\ No newline at end of file\n+lookout SDK [![GoDoc](https://godoc.org/gopkg.in/src-d/lookout-sdk.v0?status.svg)](https://godoc.org/github.com/src-d/lookout-sdk) [![PyPI version](https://badge.fury.io/py/lookout-sdk.svg)](https://pypi.org/project/lookout-sdk/) [![Build Status](https://travis-ci.org/src-d/src-d/lookout-sdk.svg)](https://travis-ci.org/src-d/src-d/lookout-sdk)\n+-----------\n+\n+What is lookout SDK?\n+===================\n+Lookout SDK is toolkit for writing new analyzers for the [lookout](https://github.com/src-d/lookout/).\n+\n+\n+What does it provide\n+====================\n+It provides to analyzer an easy access to the DataService API though gRPC service.\n+\n+DataService abstracts all data access and details of dealing witn actual Git repositories, UAST extraction, programming language detection, etc. This way analyzer can only focus on source code analysis logic.\n+\n+Architecture of lookout and it's componetes are described in [src-d/lookout/docs](https://github.com/src-d/lookout/tree/master/docs#lookout)\n+\n+SDK includes:\n+ - proto definitinos\n+ - pre-generate libraries code for Golang and Python\n+ - quickstart documentation on how to write an anlyzer\n+\n+\n+How to create a new Analyzer\n+============================\n+\n+Essentially, every analyzer is a [gRCP server](https://grpc.io/docs/guides/#overview) that implements [Analyzer service](./proto/service_analyzer.proto#L30). Lookout itself act as a gRCP client and will push your analyzer whenever a new PR is ready for anlysis.\n+\n+### Golang\n+ - using pre-generated code `gopkg.in/src-d/lookout-sdk.v0/pb`\n+ - implement Analyzer service interface. Example:\n+   ```go\n+   NotifyReviewEvent(ctx context.Context, review *pb.ReviewEvent) (*pb.EventResponse, error)\n+   NotifyPushEvent(context.Context, *pb.PushEvent) (*pb.EventResponse, error)\n+   ```\n+   - analyzer should request [a stream of](https://grpc.io/docs/tutorials/basic/go.html#server-side-streaming-rpc-1) files and UASTs from [DataService](./proto/service_data.proto#L27) that lookout exposed, by default, on `localhost:10301`\n+   - analyzer have [options](./proto/service_data.proto#L61) to ask either for all files, or just a changed ones, as well as UASTs, language, full file content and/or exclude some paths: by regexp, or just all [vendored paths](https://github.com/github/linguist/blob/master/lib/linguist/vendor.yml)\n+   - analyzer have to return a list of [Comment](./proto/service_analyzer.proto#L42) messages\n+ - run gRPC server to listen for requests from the lookout\n+\n+ SDK contains a quickstart exmaple of the Analyzer that detects language and number of functions for every file [language-analyzer.go](./language-analyzer.go):","path":"README.md","position":42,"original_position":42,"commit_id":"d7eeee928dba85400cca48012e1c06890e91b653","original_commit_id":"d7eeee928dba85400cca48012e1c06890e91b653","user":{"login":"carlosms","id":1469173,"node_id":"MDQ6VXNlcjE0NjkxNzM=","avatar_url":"https://avatars0.githubusercontent.com/u/1469173?v=4","gravatar_id":"","url":"https://api.github.com/users/carlosms","html_url":"https://github.com/carlosms","followers_url":"https://api.github.com/users/carlosms/followers","following_url":"https://api.github.com/users/carlosms/following{/other_user}","gists_url":"https://api.github.com/users/carlosms/gists{/gist_id}","starred_url":"https://api.github.com/users/carlosms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carlosms/subscriptions","organizations_url":"https://api.github.com/users/carlosms/orgs","repos_url":"https://api.github.com/users/carlosms/repos","events_url":"https://api.github.com/users/carlosms/events{/privacy}","received_events_url":"https://api.github.com/users/carlosms/received_events","type":"User","site_admin":false},"body":"**example** of **an** Analyzer","created_at":"2018-09-03T09:51:56Z","updated_at":"2018-09-03T09:57:37Z","html_url":"https://github.com/src-d/lookout-sdk/pull/1#discussion_r214633766","pull_request_url":"https://api.github.com/repos/src-d/lookout-sdk/pulls/1","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/src-d/lookout-sdk/pulls/comments/214633766"},"html":{"href":"https://github.com/src-d/lookout-sdk/pull/1#discussion_r214633766"},"pull_request":{"href":"https://api.github.com/repos/src-d/lookout-sdk/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/src-d/lookout-sdk/pulls/1","id":212203340,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEyMjAzMzQw","html_url":"https://github.com/src-d/lookout-sdk/pull/1","diff_url":"https://github.com/src-d/lookout-sdk/pull/1.diff","patch_url":"https://github.com/src-d/lookout-sdk/pull/1.patch","issue_url":"https://api.github.com/repos/src-d/lookout-sdk/issues/1","number":1,"state":"open","locked":false,"title":"lookout SDK alpha","user":{"login":"bzz","id":5582506,"node_id":"MDQ6VXNlcjU1ODI1MDY=","avatar_url":"https://avatars3.githubusercontent.com/u/5582506?v=4","gravatar_id":"","url":"https://api.github.com/users/bzz","html_url":"https://github.com/bzz","followers_url":"https://api.github.com/users/bzz/followers","following_url":"https://api.github.com/users/bzz/following{/other_user}","gists_url":"https://api.github.com/users/bzz/gists{/gist_id}","starred_url":"https://api.github.com/users/bzz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bzz/subscriptions","organizations_url":"https://api.github.com/users/bzz/orgs","repos_url":"https://api.github.com/users/bzz/repos","events_url":"https://api.github.com/users/bzz/events{/privacy}","received_events_url":"https://api.github.com/users/bzz/received_events","type":"User","site_admin":false},"body":"Addresses https://github.com/src-d/lookout/issues/200 and https://github.com/src-d/lookout/issues/201 by keeping proto, Golang and Python generated code in single repo.\r\n\r\nTODOs\r\n=====\r\n - [x] .proto\r\n - [x] README\r\n   * links to pypi, godoc, travis\r\n - [x] go: generated cod\r\n - [x] go: example\r\n - [x] py: generated code\r\n - [x] py: example\r\n - [x] py: `lookout_sdk` library\r\n - [x] .sh for generating code\r\n - [x] .travis.yml\r\n     - make no-changes-in-commit\r\n     - publish `lookout_sdk` on pypi\r\n     - Integration test for examples\r\n","created_at":"2018-08-30T20:36:20Z","updated_at":"2018-09-03T09:57:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6186580afbd214380fafa1feba7d7bf2948ef543","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/src-d/lookout-sdk/pulls/1/commits","review_comments_url":"https://api.github.com/repos/src-d/lookout-sdk/pulls/1/comments","review_comment_url":"https://api.github.com/repos/src-d/lookout-sdk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/src-d/lookout-sdk/issues/1/comments","statuses_url":"https://api.github.com/repos/src-d/lookout-sdk/statuses/d7eeee928dba85400cca48012e1c06890e91b653","head":{"label":"bzz:alpha-sdk","ref":"alpha-sdk","sha":"d7eeee928dba85400cca48012e1c06890e91b653","user":{"login":"bzz","id":5582506,"node_id":"MDQ6VXNlcjU1ODI1MDY=","avatar_url":"https://avatars3.githubusercontent.com/u/5582506?v=4","gravatar_id":"","url":"https://api.github.com/users/bzz","html_url":"https://github.com/bzz","followers_url":"https://api.github.com/users/bzz/followers","following_url":"https://api.github.com/users/bzz/following{/other_user}","gists_url":"https://api.github.com/users/bzz/gists{/gist_id}","starred_url":"https://api.github.com/users/bzz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bzz/subscriptions","organizations_url":"https://api.github.com/users/bzz/orgs","repos_url":"https://api.github.com/users/bzz/repos","events_url":"https://api.github.com/users/bzz/events{/privacy}","received_events_url":"https://api.github.com/users/bzz/received_events","type":"User","site_admin":false},"repo":{"id":146803664,"node_id":"MDEwOlJlcG9zaXRvcnkxNDY4MDM2NjQ=","name":"lookout-sdk","full_name":"bzz/lookout-sdk","owner":{"login":"bzz","id":5582506,"node_id":"MDQ6VXNlcjU1ODI1MDY=","avatar_url":"https://avatars3.githubusercontent.com/u/5582506?v=4","gravatar_id":"","url":"https://api.github.com/users/bzz","html_url":"https://github.com/bzz","followers_url":"https://api.github.com/users/bzz/followers","following_url":"https://api.github.com/users/bzz/following{/other_user}","gists_url":"https://api.github.com/users/bzz/gists{/gist_id}","starred_url":"https://api.github.com/users/bzz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bzz/subscriptions","organizations_url":"https://api.github.com/users/bzz/orgs","repos_url":"https://api.github.com/users/bzz/repos","events_url":"https://api.github.com/users/bzz/events{/privacy}","received_events_url":"https://api.github.com/users/bzz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bzz/lookout-sdk","description":"SDK for lookout analyzers","fork":true,"url":"https://api.github.com/repos/bzz/lookout-sdk","forks_url":"https://api.github.com/repos/bzz/lookout-sdk/forks","keys_url":"https://api.github.com/repos/bzz/lookout-sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bzz/lookout-sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bzz/lookout-sdk/teams","hooks_url":"https://api.github.com/repos/bzz/lookout-sdk/hooks","issue_events_url":"https://api.github.com/repos/bzz/lookout-sdk/issues/events{/number}","events_url":"https://api.github.com/repos/bzz/lookout-sdk/events","assignees_url":"https://api.github.com/repos/bzz/lookout-sdk/assignees{/user}","branches_url":"https://api.github.com/repos/bzz/lookout-sdk/branches{/branch}","tags_url":"https://api.github.com/repos/bzz/lookout-sdk/tags","blobs_url":"https://api.github.com/repos/bzz/lookout-sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bzz/lookout-sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bzz/lookout-sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/bzz/lookout-sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bzz/lookout-sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/bzz/lookout-sdk/languages","stargazers_url":"https://api.github.com/repos/bzz/lookout-sdk/stargazers","contributors_url":"https://api.github.com/repos/bzz/lookout-sdk/contributors","subscribers_url":"https://api.github.com/repos/bzz/lookout-sdk/subscribers","subscription_url":"https://api.github.com/repos/bzz/lookout-sdk/subscription","commits_url":"https://api.github.com/repos/bzz/lookout-sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/bzz/lookout-sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/bzz/lookout-sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/bzz/lookout-sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/bzz/lookout-sdk/contents/{+path}","compare_url":"https://api.github.com/repos/bzz/lookout-sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bzz/lookout-sdk/merges","archive_url":"https://api.github.com/repos/bzz/lookout-sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bzz/lookout-sdk/downloads","issues_url":"https://api.github.com/repos/bzz/lookout-sdk/issues{/number}","pulls_url":"https://api.github.com/repos/bzz/lookout-sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/bzz/lookout-sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/bzz/lookout-sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bzz/lookout-sdk/labels{/name}","releases_url":"https://api.github.com/repos/bzz/lookout-sdk/releases{/id}","deployments_url":"https://api.github.com/repos/bzz/lookout-sdk/deployments","created_at":"2018-08-30T20:33:55Z","updated_at":"2018-09-03T07:54:47Z","pushed_at":"2018-09-03T08:37:13Z","git_url":"git://github.com/bzz/lookout-sdk.git","ssh_url":"git@github.com:bzz/lookout-sdk.git","clone_url":"https://github.com/bzz/lookout-sdk.git","svn_url":"https://github.com/bzz/lookout-sdk","homepage":null,"size":80,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"src-d:master","ref":"master","sha":"00ee1fe8f627e5b47958b89b1dd044980b5a3a83","user":{"login":"src-d","id":15128793,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1MTI4Nzkz","avatar_url":"https://avatars2.githubusercontent.com/u/15128793?v=4","gravatar_id":"","url":"https://api.github.com/users/src-d","html_url":"https://github.com/src-d","followers_url":"https://api.github.com/users/src-d/followers","following_url":"https://api.github.com/users/src-d/following{/other_user}","gists_url":"https://api.github.com/users/src-d/gists{/gist_id}","starred_url":"https://api.github.com/users/src-d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/src-d/subscriptions","organizations_url":"https://api.github.com/users/src-d/orgs","repos_url":"https://api.github.com/users/src-d/repos","events_url":"https://api.github.com/users/src-d/events{/privacy}","received_events_url":"https://api.github.com/users/src-d/received_events","type":"Organization","site_admin":false},"repo":{"id":146800972,"node_id":"MDEwOlJlcG9zaXRvcnkxNDY4MDA5NzI=","name":"lookout-sdk","full_name":"src-d/lookout-sdk","owner":{"login":"src-d","id":15128793,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1MTI4Nzkz","avatar_url":"https://avatars2.githubusercontent.com/u/15128793?v=4","gravatar_id":"","url":"https://api.github.com/users/src-d","html_url":"https://github.com/src-d","followers_url":"https://api.github.com/users/src-d/followers","following_url":"https://api.github.com/users/src-d/following{/other_user}","gists_url":"https://api.github.com/users/src-d/gists{/gist_id}","starred_url":"https://api.github.com/users/src-d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/src-d/subscriptions","organizations_url":"https://api.github.com/users/src-d/orgs","repos_url":"https://api.github.com/users/src-d/repos","events_url":"https://api.github.com/users/src-d/events{/privacy}","received_events_url":"https://api.github.com/users/src-d/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/src-d/lookout-sdk","description":"SDK for lookout analyzers","fork":false,"url":"https://api.github.com/repos/src-d/lookout-sdk","forks_url":"https://api.github.com/repos/src-d/lookout-sdk/forks","keys_url":"https://api.github.com/repos/src-d/lookout-sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/src-d/lookout-sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/src-d/lookout-sdk/teams","hooks_url":"https://api.github.com/repos/src-d/lookout-sdk/hooks","issue_events_url":"https://api.github.com/repos/src-d/lookout-sdk/issues/events{/number}","events_url":"https://api.github.com/repos/src-d/lookout-sdk/events","assignees_url":"https://api.github.com/repos/src-d/lookout-sdk/assignees{/user}","branches_url":"https://api.github.com/repos/src-d/lookout-sdk/branches{/branch}","tags_url":"https://api.github.com/repos/src-d/lookout-sdk/tags","blobs_url":"https://api.github.com/repos/src-d/lookout-sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/src-d/lookout-sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/src-d/lookout-sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/src-d/lookout-sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/src-d/lookout-sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/src-d/lookout-sdk/languages","stargazers_url":"https://api.github.com/repos/src-d/lookout-sdk/stargazers","contributors_url":"https://api.github.com/repos/src-d/lookout-sdk/contributors","subscribers_url":"https://api.github.com/repos/src-d/lookout-sdk/subscribers","subscription_url":"https://api.github.com/repos/src-d/lookout-sdk/subscription","commits_url":"https://api.github.com/repos/src-d/lookout-sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/src-d/lookout-sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/src-d/lookout-sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/src-d/lookout-sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/src-d/lookout-sdk/contents/{+path}","compare_url":"https://api.github.com/repos/src-d/lookout-sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/src-d/lookout-sdk/merges","archive_url":"https://api.github.com/repos/src-d/lookout-sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/src-d/lookout-sdk/downloads","issues_url":"https://api.github.com/repos/src-d/lookout-sdk/issues{/number}","pulls_url":"https://api.github.com/repos/src-d/lookout-sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/src-d/lookout-sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/src-d/lookout-sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/src-d/lookout-sdk/labels{/name}","releases_url":"https://api.github.com/repos/src-d/lookout-sdk/releases{/id}","deployments_url":"https://api.github.com/repos/src-d/lookout-sdk/deployments","created_at":"2018-08-30T20:06:37Z","updated_at":"2018-08-30T20:33:40Z","pushed_at":"2018-09-03T08:37:14Z","git_url":"git://github.com/src-d/lookout-sdk.git","ssh_url":"git@github.com:src-d/lookout-sdk.git","clone_url":"https://github.com/src-d/lookout-sdk.git","svn_url":"https://github.com/src-d/lookout-sdk","homepage":null,"size":4,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/src-d/lookout-sdk/pulls/1"},"html":{"href":"https://github.com/src-d/lookout-sdk/pull/1"},"issue":{"href":"https://api.github.com/repos/src-d/lookout-sdk/issues/1"},"comments":{"href":"https://api.github.com/repos/src-d/lookout-sdk/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/src-d/lookout-sdk/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/src-d/lookout-sdk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/src-d/lookout-sdk/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/src-d/lookout-sdk/statuses/d7eeee928dba85400cca48012e1c06890e91b653"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"carlosms"}}