Repository: chakki-works/typot
Branch: master
Commit: 8ed20fc2102a
Files: 19
Total size: 136.2 KB
Directory structure:
gitextract_cd9khm8x/
├── .gitignore
├── Dockerfile
├── LICENSE
├── Procfile
├── README.md
├── get_installations.py
├── requirements.txt
├── tests/
│ ├── dummy_data.py
│ ├── get_installation_id.py
│ ├── test_diff_content.py
│ ├── test_env.py
│ ├── test_pull_request.py
│ └── test_spell_checker.py
└── typot/
├── __init__.py
├── api.py
├── env.py
├── model.py
├── pull_request.py
└── spell_checker.py
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# pyenv
.python-version
# celery beat schedule file
celerybeat-schedule
# SageMath parsed files
*.sage.py
# dotenv
.env
# virtualenv
.venv
venv/
ENV/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.DS_Store
typot.pem
envs.json
tests/test_installation_id.json
================================================
FILE: Dockerfile
================================================
FROM python:3.4.5
RUN apt-get update
RUN apt-get install -y enchant
ADD ./requirements.txt /tmp/requirements.txt
RUN pip install -qr /tmp/requirements.txt
ADD ./typot /opt/typot/
WORKDIR /opt/typot
# Expose is NOT supported by Heroku
# EXPOSE 8000
CMD hug -p $PORT -f /opt/typot/api.py
================================================
FILE: LICENSE
================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2017 chakki
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
================================================
FILE: Procfile
================================================
web: hug -f typot/api.py
================================================
FILE: README.md
================================================
# typot
**typot** detects the typos in your pull request, and fix it by just selecting the modification candidates.

1. When you open the pull request, *typot* checks it and if there are typos, make review comments on it.
2. If suitable fix is in suggested candidates, then select it! *typot* adopts it automatically.
Now, README file and all `.md` and `.rst` files are check target.
## Install
**[Please Authorize typot from this Link!](https://github.com/apps/typot)**
## Dependencies
* [hug](http://www.hug.rest/)
* [PyEnchant](http://pythonhosted.org/pyenchant/)
* [unidiff](https://github.com/matiasb/python-unidiff)
* [PyJWT](https://github.com/jpadilla/pyjwt)
*icon's photo from [independentman](https://flic.kr/p/2mHSE)*
================================================
FILE: get_installations.py
================================================
import os
import argparse
from datetime import datetime, timedelta
import requests
import jwt
def get_private_pem(file_path):
key = os.environ.get("PRIVATE_KEY", "")
if not key:
default_path = os.path.join(os.path.dirname(__file__), file_path)
if os.path.exists(default_path):
with open(default_path, "r", encoding="utf-8") as f:
key = f.readlines()
key = "".join(key)
return key
parser = argparse.ArgumentParser(description="Get Installations count of your App.")
parser.add_argument("app_id", help="app_id of Your apps")
parser.add_argument("--pem", default="", help="path to pem file")
if __name__ == "__main__":
url = "https://api.github.com/app/installations"
args = parser.parse_args()
pem_path = args.pem
if not pem_path:
path = os.path.abspath(os.path.dirname(__file__))
app_name = os.path.basename(path)
pem_path = app_name + ".pem"
if not os.path.exists(pem_path):
raise Exception("Pem file {} does not exist".format(pem_path))
utcnow = datetime.utcnow() + timedelta(seconds=-5)
duration = timedelta(seconds=10)
payload = {
"iat": utcnow,
"exp": utcnow + duration,
"iss": args.app_id
}
pem = get_private_pem(pem_path)
encoded = jwt.encode(payload, pem, "RS256")
headers = {
"Authorization": "Bearer " + encoded.decode("utf-8"),
"Accept": "application/vnd.github.machine-man-preview+json"
}
r = requests.get(url, headers=headers)
if r.ok:
print(len(r.json()))
else:
r.raise_for_status()
================================================
FILE: requirements.txt
================================================
hug==2.3.0
requests==2.14.2
unidiff==0.5.3
pyenchant==1.6.8
PyJWT==1.5.0
cryptography==1.8.2
================================================
FILE: tests/dummy_data.py
================================================
pull_request_created = """
{
"action": "opened",
"number": 2,
"pull_request": {
"url": "https://api.github.com/repos/chakki-works/typot-demo/pulls/2",
"id": 122156051,
"html_url": "https://github.com/chakki-works/typot-demo/pull/2",
"diff_url": "https://github.com/chakki-works/typot-demo/pull/2.diff",
"patch_url": "https://github.com/chakki-works/typot-demo/pull/2.patch",
"issue_url": "https://api.github.com/repos/chakki-works/typot-demo/issues/2",
"number": 2,
"state": "open",
"locked": false,
"title": "Update README.md",
"user": {
"login": "icoxfog417",
"id": 544269,
"avatar_url": "https://avatars3.githubusercontent.com/u/544269?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/icoxfog417",
"html_url": "https://github.com/icoxfog417",
"followers_url": "https://api.github.com/users/icoxfog417/followers",
"following_url": "https://api.github.com/users/icoxfog417/following{/other_user}",
"gists_url": "https://api.github.com/users/icoxfog417/gists{/gist_id}",
"starred_url": "https://api.github.com/users/icoxfog417/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/icoxfog417/subscriptions",
"organizations_url": "https://api.github.com/users/icoxfog417/orgs",
"repos_url": "https://api.github.com/users/icoxfog417/repos",
"events_url": "https://api.github.com/users/icoxfog417/events{/privacy}",
"received_events_url": "https://api.github.com/users/icoxfog417/received_events",
"type": "User",
"site_admin": false
},
"body": "Pull Request Create Test",
"created_at": "2017-05-24T06:50:51Z",
"updated_at": "2017-05-24T06:50:51Z",
"closed_at": null,
"merged_at": null,
"merge_commit_sha": null,
"assignee": null,
"assignees": [
],
"requested_reviewers": [
],
"milestone": null,
"commits_url": "https://api.github.com/repos/chakki-works/typot-demo/pulls/2/commits",
"review_comments_url": "https://api.github.com/repos/chakki-works/typot-demo/pulls/2/comments",
"review_comment_url": "https://api.github.com/repos/chakki-works/typot-demo/pulls/comments{/number}",
"comments_url": "https://api.github.com/repos/chakki-works/typot-demo/issues/2/comments",
"statuses_url": "https://api.github.com/repos/chakki-works/typot-demo/statuses/2511e9cc5b0fa1f44feebc9c29d08304e7744269",
"head": {
"label": "chakki-works:dev",
"ref": "dev",
"sha": "2511e9cc5b0fa1f44feebc9c29d08304e7744269",
"user": {
"login": "chakki-works",
"id": 25578516,
"avatar_url": "https://avatars0.githubusercontent.com/u/25578516?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/chakki-works",
"html_url": "https://github.com/chakki-works",
"followers_url": "https://api.github.com/users/chakki-works/followers",
"following_url": "https://api.github.com/users/chakki-works/following{/other_user}",
"gists_url": "https://api.github.com/users/chakki-works/gists{/gist_id}",
"starred_url": "https://api.github.com/users/chakki-works/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/chakki-works/subscriptions",
"organizations_url": "https://api.github.com/users/chakki-works/orgs",
"repos_url": "https://api.github.com/users/chakki-works/repos",
"events_url": "https://api.github.com/users/chakki-works/events{/privacy}",
"received_events_url": "https://api.github.com/users/chakki-works/received_events",
"type": "Organization",
"site_admin": false
},
"repo": {
"id": 92240778,
"name": "typot-demo",
"full_name": "chakki-works/typot-demo",
"owner": {
"login": "chakki-works",
"id": 25578516,
"avatar_url": "https://avatars0.githubusercontent.com/u/25578516?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/chakki-works",
"html_url": "https://github.com/chakki-works",
"followers_url": "https://api.github.com/users/chakki-works/followers",
"following_url": "https://api.github.com/users/chakki-works/following{/other_user}",
"gists_url": "https://api.github.com/users/chakki-works/gists{/gist_id}",
"starred_url": "https://api.github.com/users/chakki-works/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/chakki-works/subscriptions",
"organizations_url": "https://api.github.com/users/chakki-works/orgs",
"repos_url": "https://api.github.com/users/chakki-works/repos",
"events_url": "https://api.github.com/users/chakki-works/events{/privacy}",
"received_events_url": "https://api.github.com/users/chakki-works/received_events",
"type": "Organization",
"site_admin": false
},
"private": false,
"html_url": "https://github.com/chakki-works/typot-demo",
"description": "to test typot",
"fork": false,
"url": "https://api.github.com/repos/chakki-works/typot-demo",
"forks_url": "https://api.github.com/repos/chakki-works/typot-demo/forks",
"keys_url": "https://api.github.com/repos/chakki-works/typot-demo/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/chakki-works/typot-demo/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/chakki-works/typot-demo/teams",
"hooks_url": "https://api.github.com/repos/chakki-works/typot-demo/hooks",
"issue_events_url": "https://api.github.com/repos/chakki-works/typot-demo/issues/events{/number}",
"events_url": "https://api.github.com/repos/chakki-works/typot-demo/events",
"assignees_url": "https://api.github.com/repos/chakki-works/typot-demo/assignees{/user}",
"branches_url": "https://api.github.com/repos/chakki-works/typot-demo/branches{/branch}",
"tags_url": "https://api.github.com/repos/chakki-works/typot-demo/tags",
"blobs_url": "https://api.github.com/repos/chakki-works/typot-demo/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/chakki-works/typot-demo/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/chakki-works/typot-demo/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/chakki-works/typot-demo/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/chakki-works/typot-demo/statuses/{sha}",
"languages_url": "https://api.github.com/repos/chakki-works/typot-demo/languages",
"stargazers_url": "https://api.github.com/repos/chakki-works/typot-demo/stargazers",
"contributors_url": "https://api.github.com/repos/chakki-works/typot-demo/contributors",
"subscribers_url": "https://api.github.com/repos/chakki-works/typot-demo/subscribers",
"subscription_url": "https://api.github.com/repos/chakki-works/typot-demo/subscription",
"commits_url": "https://api.github.com/repos/chakki-works/typot-demo/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/chakki-works/typot-demo/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/chakki-works/typot-demo/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/chakki-works/typot-demo/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/chakki-works/typot-demo/contents/{+path}",
"compare_url": "https://api.github.com/repos/chakki-works/typot-demo/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/chakki-works/typot-demo/merges",
"archive_url": "https://api.github.com/repos/chakki-works/typot-demo/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/chakki-works/typot-demo/downloads",
"issues_url": "https://api.github.com/repos/chakki-works/typot-demo/issues{/number}",
"pulls_url": "https://api.github.com/repos/chakki-works/typot-demo/pulls{/number}",
"milestones_url": "https://api.github.com/repos/chakki-works/typot-demo/milestones{/number}",
"notifications_url": "https://api.github.com/repos/chakki-works/typot-demo/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/chakki-works/typot-demo/labels{/name}",
"releases_url": "https://api.github.com/repos/chakki-works/typot-demo/releases{/id}",
"deployments_url": "https://api.github.com/repos/chakki-works/typot-demo/deployments",
"created_at": "2017-05-24T02:24:37Z",
"updated_at": "2017-05-24T02:24:37Z",
"pushed_at": "2017-05-24T02:39:34Z",
"git_url": "git://github.com/chakki-works/typot-demo.git",
"ssh_url": "git@github.com:chakki-works/typot-demo.git",
"clone_url": "https://github.com/chakki-works/typot-demo.git",
"svn_url": "https://github.com/chakki-works/typot-demo",
"homepage": null,
"size": 1,
"stargazers_count": 0,
"watchers_count": 0,
"language": null,
"has_issues": true,
"has_projects": true,
"has_downloads": true,
"has_wiki": true,
"has_pages": false,
"forks_count": 0,
"mirror_url": null,
"open_issues_count": 1,
"forks": 0,
"open_issues": 1,
"watchers": 0,
"default_branch": "master"
}
},
"base": {
"label": "chakki-works:master",
"ref": "master",
"sha": "a2573fb6cc5612219823765d0113938c666c1855",
"user": {
"login": "chakki-works",
"id": 25578516,
"avatar_url": "https://avatars0.githubusercontent.com/u/25578516?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/chakki-works",
"html_url": "https://github.com/chakki-works",
"followers_url": "https://api.github.com/users/chakki-works/followers",
"following_url": "https://api.github.com/users/chakki-works/following{/other_user}",
"gists_url": "https://api.github.com/users/chakki-works/gists{/gist_id}",
"starred_url": "https://api.github.com/users/chakki-works/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/chakki-works/subscriptions",
"organizations_url": "https://api.github.com/users/chakki-works/orgs",
"repos_url": "https://api.github.com/users/chakki-works/repos",
"events_url": "https://api.github.com/users/chakki-works/events{/privacy}",
"received_events_url": "https://api.github.com/users/chakki-works/received_events",
"type": "Organization",
"site_admin": false
},
"repo": {
"id": 92240778,
"name": "typot-demo",
"full_name": "chakki-works/typot-demo",
"owner": {
"login": "chakki-works",
"id": 25578516,
"avatar_url": "https://avatars0.githubusercontent.com/u/25578516?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/chakki-works",
"html_url": "https://github.com/chakki-works",
"followers_url": "https://api.github.com/users/chakki-works/followers",
"following_url": "https://api.github.com/users/chakki-works/following{/other_user}",
"gists_url": "https://api.github.com/users/chakki-works/gists{/gist_id}",
"starred_url": "https://api.github.com/users/chakki-works/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/chakki-works/subscriptions",
"organizations_url": "https://api.github.com/users/chakki-works/orgs",
"repos_url": "https://api.github.com/users/chakki-works/repos",
"events_url": "https://api.github.com/users/chakki-works/events{/privacy}",
"received_events_url": "https://api.github.com/users/chakki-works/received_events",
"type": "Organization",
"site_admin": false
},
"private": false,
"html_url": "https://github.com/chakki-works/typot-demo",
"description": "to test typot",
"fork": false,
"url": "https://api.github.com/repos/chakki-works/typot-demo",
"forks_url": "https://api.github.com/repos/chakki-works/typot-demo/forks",
"keys_url": "https://api.github.com/repos/chakki-works/typot-demo/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/chakki-works/typot-demo/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/chakki-works/typot-demo/teams",
"hooks_url": "https://api.github.com/repos/chakki-works/typot-demo/hooks",
"issue_events_url": "https://api.github.com/repos/chakki-works/typot-demo/issues/events{/number}",
"events_url": "https://api.github.com/repos/chakki-works/typot-demo/events",
"assignees_url": "https://api.github.com/repos/chakki-works/typot-demo/assignees{/user}",
"branches_url": "https://api.github.com/repos/chakki-works/typot-demo/branches{/branch}",
"tags_url": "https://api.github.com/repos/chakki-works/typot-demo/tags",
"blobs_url": "https://api.github.com/repos/chakki-works/typot-demo/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/chakki-works/typot-demo/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/chakki-works/typot-demo/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/chakki-works/typot-demo/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/chakki-works/typot-demo/statuses/{sha}",
"languages_url": "https://api.github.com/repos/chakki-works/typot-demo/languages",
"stargazers_url": "https://api.github.com/repos/chakki-works/typot-demo/stargazers",
"contributors_url": "https://api.github.com/repos/chakki-works/typot-demo/contributors",
"subscribers_url": "https://api.github.com/repos/chakki-works/typot-demo/subscribers",
"subscription_url": "https://api.github.com/repos/chakki-works/typot-demo/subscription",
"commits_url": "https://api.github.com/repos/chakki-works/typot-demo/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/chakki-works/typot-demo/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/chakki-works/typot-demo/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/chakki-works/typot-demo/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/chakki-works/typot-demo/contents/{+path}",
"compare_url": "https://api.github.com/repos/chakki-works/typot-demo/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/chakki-works/typot-demo/merges",
"archive_url": "https://api.github.com/repos/chakki-works/typot-demo/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/chakki-works/typot-demo/downloads",
"issues_url": "https://api.github.com/repos/chakki-works/typot-demo/issues{/number}",
"pulls_url": "https://api.github.com/repos/chakki-works/typot-demo/pulls{/number}",
"milestones_url": "https://api.github.com/repos/chakki-works/typot-demo/milestones{/number}",
"notifications_url": "https://api.github.com/repos/chakki-works/typot-demo/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/chakki-works/typot-demo/labels{/name}",
"releases_url": "https://api.github.com/repos/chakki-works/typot-demo/releases{/id}",
"deployments_url": "https://api.github.com/repos/chakki-works/typot-demo/deployments",
"created_at": "2017-05-24T02:24:37Z",
"updated_at": "2017-05-24T02:24:37Z",
"pushed_at": "2017-05-24T02:39:34Z",
"git_url": "git://github.com/chakki-works/typot-demo.git",
"ssh_url": "git@github.com:chakki-works/typot-demo.git",
"clone_url": "https://github.com/chakki-works/typot-demo.git",
"svn_url": "https://github.com/chakki-works/typot-demo",
"homepage": null,
"size": 1,
"stargazers_count": 0,
"watchers_count": 0,
"language": null,
"has_issues": true,
"has_projects": true,
"has_downloads": true,
"has_wiki": true,
"has_pages": false,
"forks_count": 0,
"mirror_url": null,
"open_issues_count": 1,
"forks": 0,
"open_issues": 1,
"watchers": 0,
"default_branch": "master"
}
},
"_links": {
"self": {
"href": "https://api.github.com/repos/chakki-works/typot-demo/pulls/2"
},
"html": {
"href": "https://github.com/chakki-works/typot-demo/pull/2"
},
"issue": {
"href": "https://api.github.com/repos/chakki-works/typot-demo/issues/2"
},
"comments": {
"href": "https://api.github.com/repos/chakki-works/typot-demo/issues/2/comments"
},
"review_comments": {
"href": "https://api.github.com/repos/chakki-works/typot-demo/pulls/2/comments"
},
"review_comment": {
"href": "https://api.github.com/repos/chakki-works/typot-demo/pulls/comments{/number}"
},
"commits": {
"href": "https://api.github.com/repos/chakki-works/typot-demo/pulls/2/commits"
},
"statuses": {
"href": "https://api.github.com/repos/chakki-works/typot-demo/statuses/2511e9cc5b0fa1f44feebc9c29d08304e7744269"
}
},
"merged": false,
"mergeable": null,
"rebaseable": null,
"mergeable_state": "unknown",
"merged_by": null,
"comments": 0,
"review_comments": 0,
"maintainer_can_modify": false,
"commits": 1,
"additions": 1,
"deletions": 1,
"changed_files": 1
},
"repository": {
"id": 92240778,
"name": "typot-demo",
"full_name": "chakki-works/typot-demo",
"owner": {
"login": "chakki-works",
"id": 25578516,
"avatar_url": "https://avatars0.githubusercontent.com/u/25578516?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/chakki-works",
"html_url": "https://github.com/chakki-works",
"followers_url": "https://api.github.com/users/chakki-works/followers",
"following_url": "https://api.github.com/users/chakki-works/following{/other_user}",
"gists_url": "https://api.github.com/users/chakki-works/gists{/gist_id}",
"starred_url": "https://api.github.com/users/chakki-works/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/chakki-works/subscriptions",
"organizations_url": "https://api.github.com/users/chakki-works/orgs",
"repos_url": "https://api.github.com/users/chakki-works/repos",
"events_url": "https://api.github.com/users/chakki-works/events{/privacy}",
"received_events_url": "https://api.github.com/users/chakki-works/received_events",
"type": "Organization",
"site_admin": false
},
"private": false,
"html_url": "https://github.com/chakki-works/typot-demo",
"description": "to test typot",
"fork": false,
"url": "https://api.github.com/repos/chakki-works/typot-demo",
"forks_url": "https://api.github.com/repos/chakki-works/typot-demo/forks",
"keys_url": "https://api.github.com/repos/chakki-works/typot-demo/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/chakki-works/typot-demo/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/chakki-works/typot-demo/teams",
"hooks_url": "https://api.github.com/repos/chakki-works/typot-demo/hooks",
"issue_events_url": "https://api.github.com/repos/chakki-works/typot-demo/issues/events{/number}",
"events_url": "https://api.github.com/repos/chakki-works/typot-demo/events",
"assignees_url": "https://api.github.com/repos/chakki-works/typot-demo/assignees{/user}",
"branches_url": "https://api.github.com/repos/chakki-works/typot-demo/branches{/branch}",
"tags_url": "https://api.github.com/repos/chakki-works/typot-demo/tags",
"blobs_url": "https://api.github.com/repos/chakki-works/typot-demo/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/chakki-works/typot-demo/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/chakki-works/typot-demo/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/chakki-works/typot-demo/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/chakki-works/typot-demo/statuses/{sha}",
"languages_url": "https://api.github.com/repos/chakki-works/typot-demo/languages",
"stargazers_url": "https://api.github.com/repos/chakki-works/typot-demo/stargazers",
"contributors_url": "https://api.github.com/repos/chakki-works/typot-demo/contributors",
"subscribers_url": "https://api.github.com/repos/chakki-works/typot-demo/subscribers",
"subscription_url": "https://api.github.com/repos/chakki-works/typot-demo/subscription",
"commits_url": "https://api.github.com/repos/chakki-works/typot-demo/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/chakki-works/typot-demo/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/chakki-works/typot-demo/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/chakki-works/typot-demo/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/chakki-works/typot-demo/contents/{+path}",
"compare_url": "https://api.github.com/repos/chakki-works/typot-demo/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/chakki-works/typot-demo/merges",
"archive_url": "https://api.github.com/repos/chakki-works/typot-demo/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/chakki-works/typot-demo/downloads",
"issues_url": "https://api.github.com/repos/chakki-works/typot-demo/issues{/number}",
"pulls_url": "https://api.github.com/repos/chakki-works/typot-demo/pulls{/number}",
"milestones_url": "https://api.github.com/repos/chakki-works/typot-demo/milestones{/number}",
"notifications_url": "https://api.github.com/repos/chakki-works/typot-demo/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/chakki-works/typot-demo/labels{/name}",
"releases_url": "https://api.github.com/repos/chakki-works/typot-demo/releases{/id}",
"deployments_url": "https://api.github.com/repos/chakki-works/typot-demo/deployments",
"created_at": "2017-05-24T02:24:37Z",
"updated_at": "2017-05-24T02:24:37Z",
"pushed_at": "2017-05-24T02:39:34Z",
"git_url": "git://github.com/chakki-works/typot-demo.git",
"ssh_url": "git@github.com:chakki-works/typot-demo.git",
"clone_url": "https://github.com/chakki-works/typot-demo.git",
"svn_url": "https://github.com/chakki-works/typot-demo",
"homepage": null,
"size": 1,
"stargazers_count": 0,
"watchers_count": 0,
"language": null,
"has_issues": true,
"has_projects": true,
"has_downloads": true,
"has_wiki": true,
"has_pages": false,
"forks_count": 0,
"mirror_url": null,
"open_issues_count": 1,
"forks": 0,
"open_issues": 1,
"watchers": 0,
"default_branch": "master"
},
"organization": {
"login": "chakki-works",
"id": 25578516,
"url": "https://api.github.com/orgs/chakki-works",
"repos_url": "https://api.github.com/orgs/chakki-works/repos",
"events_url": "https://api.github.com/orgs/chakki-works/events",
"hooks_url": "https://api.github.com/orgs/chakki-works/hooks",
"issues_url": "https://api.github.com/orgs/chakki-works/issues",
"members_url": "https://api.github.com/orgs/chakki-works/members{/member}",
"public_members_url": "https://api.github.com/orgs/chakki-works/public_members{/member}",
"avatar_url": "https://avatars0.githubusercontent.com/u/25578516?v=3",
"description": "Our mission is to enable everyone leave the office by the tea time"
},
"sender": {
"login": "icoxfog417",
"id": 544269,
"avatar_url": "https://avatars3.githubusercontent.com/u/544269?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/icoxfog417",
"html_url": "https://github.com/icoxfog417",
"followers_url": "https://api.github.com/users/icoxfog417/followers",
"following_url": "https://api.github.com/users/icoxfog417/following{/other_user}",
"gists_url": "https://api.github.com/users/icoxfog417/gists{/gist_id}",
"starred_url": "https://api.github.com/users/icoxfog417/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/icoxfog417/subscriptions",
"organizations_url": "https://api.github.com/users/icoxfog417/orgs",
"repos_url": "https://api.github.com/users/icoxfog417/repos",
"events_url": "https://api.github.com/users/icoxfog417/events{/privacy}",
"received_events_url": "https://api.github.com/users/icoxfog417/received_events",
"type": "User",
"site_admin": false
},
"installation": {
"id": 1111
}
}
"""
pull_request_closed = """
{
"action": "closed",
"number": 2,
"pull_request": {
"url": "https://api.github.com/repos/chakki-works/typot-demo/pulls/2",
"id": 122156051,
"html_url": "https://github.com/chakki-works/typot-demo/pull/2",
"diff_url": "https://github.com/chakki-works/typot-demo/pull/2.diff",
"patch_url": "https://github.com/chakki-works/typot-demo/pull/2.patch",
"issue_url": "https://api.github.com/repos/chakki-works/typot-demo/issues/2",
"number": 2,
"state": "closed",
"locked": false,
"title": "Update README.md",
"user": {
"login": "icoxfog417",
"id": 544269,
"avatar_url": "https://avatars3.githubusercontent.com/u/544269?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/icoxfog417",
"html_url": "https://github.com/icoxfog417",
"followers_url": "https://api.github.com/users/icoxfog417/followers",
"following_url": "https://api.github.com/users/icoxfog417/following{/other_user}",
"gists_url": "https://api.github.com/users/icoxfog417/gists{/gist_id}",
"starred_url": "https://api.github.com/users/icoxfog417/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/icoxfog417/subscriptions",
"organizations_url": "https://api.github.com/users/icoxfog417/orgs",
"repos_url": "https://api.github.com/users/icoxfog417/repos",
"events_url": "https://api.github.com/users/icoxfog417/events{/privacy}",
"received_events_url": "https://api.github.com/users/icoxfog417/received_events",
"type": "User",
"site_admin": false
},
"body": "Pull Request Create Test",
"created_at": "2017-05-24T06:50:51Z",
"updated_at": "2017-05-24T07:05:40Z",
"closed_at": "2017-05-24T07:05:39Z",
"merged_at": "2017-05-24T07:05:39Z",
"merge_commit_sha": "7d895e85cddbb7b0adf976d14ef717f2617a6876",
"assignee": null,
"assignees": [
],
"requested_reviewers": [
],
"milestone": null,
"commits_url": "https://api.github.com/repos/chakki-works/typot-demo/pulls/2/commits",
"review_comments_url": "https://api.github.com/repos/chakki-works/typot-demo/pulls/2/comments",
"review_comment_url": "https://api.github.com/repos/chakki-works/typot-demo/pulls/comments{/number}",
"comments_url": "https://api.github.com/repos/chakki-works/typot-demo/issues/2/comments",
"statuses_url": "https://api.github.com/repos/chakki-works/typot-demo/statuses/2511e9cc5b0fa1f44feebc9c29d08304e7744269",
"head": {
"label": "chakki-works:dev",
"ref": "dev",
"sha": "2511e9cc5b0fa1f44feebc9c29d08304e7744269",
"user": {
"login": "chakki-works",
"id": 25578516,
"avatar_url": "https://avatars0.githubusercontent.com/u/25578516?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/chakki-works",
"html_url": "https://github.com/chakki-works",
"followers_url": "https://api.github.com/users/chakki-works/followers",
"following_url": "https://api.github.com/users/chakki-works/following{/other_user}",
"gists_url": "https://api.github.com/users/chakki-works/gists{/gist_id}",
"starred_url": "https://api.github.com/users/chakki-works/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/chakki-works/subscriptions",
"organizations_url": "https://api.github.com/users/chakki-works/orgs",
"repos_url": "https://api.github.com/users/chakki-works/repos",
"events_url": "https://api.github.com/users/chakki-works/events{/privacy}",
"received_events_url": "https://api.github.com/users/chakki-works/received_events",
"type": "Organization",
"site_admin": false
},
"repo": {
"id": 92240778,
"name": "typot-demo",
"full_name": "chakki-works/typot-demo",
"owner": {
"login": "chakki-works",
"id": 25578516,
"avatar_url": "https://avatars0.githubusercontent.com/u/25578516?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/chakki-works",
"html_url": "https://github.com/chakki-works",
"followers_url": "https://api.github.com/users/chakki-works/followers",
"following_url": "https://api.github.com/users/chakki-works/following{/other_user}",
"gists_url": "https://api.github.com/users/chakki-works/gists{/gist_id}",
"starred_url": "https://api.github.com/users/chakki-works/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/chakki-works/subscriptions",
"organizations_url": "https://api.github.com/users/chakki-works/orgs",
"repos_url": "https://api.github.com/users/chakki-works/repos",
"events_url": "https://api.github.com/users/chakki-works/events{/privacy}",
"received_events_url": "https://api.github.com/users/chakki-works/received_events",
"type": "Organization",
"site_admin": false
},
"private": false,
"html_url": "https://github.com/chakki-works/typot-demo",
"description": "to test typot",
"fork": false,
"url": "https://api.github.com/repos/chakki-works/typot-demo",
"forks_url": "https://api.github.com/repos/chakki-works/typot-demo/forks",
"keys_url": "https://api.github.com/repos/chakki-works/typot-demo/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/chakki-works/typot-demo/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/chakki-works/typot-demo/teams",
"hooks_url": "https://api.github.com/repos/chakki-works/typot-demo/hooks",
"issue_events_url": "https://api.github.com/repos/chakki-works/typot-demo/issues/events{/number}",
"events_url": "https://api.github.com/repos/chakki-works/typot-demo/events",
"assignees_url": "https://api.github.com/repos/chakki-works/typot-demo/assignees{/user}",
"branches_url": "https://api.github.com/repos/chakki-works/typot-demo/branches{/branch}",
"tags_url": "https://api.github.com/repos/chakki-works/typot-demo/tags",
"blobs_url": "https://api.github.com/repos/chakki-works/typot-demo/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/chakki-works/typot-demo/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/chakki-works/typot-demo/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/chakki-works/typot-demo/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/chakki-works/typot-demo/statuses/{sha}",
"languages_url": "https://api.github.com/repos/chakki-works/typot-demo/languages",
"stargazers_url": "https://api.github.com/repos/chakki-works/typot-demo/stargazers",
"contributors_url": "https://api.github.com/repos/chakki-works/typot-demo/contributors",
"subscribers_url": "https://api.github.com/repos/chakki-works/typot-demo/subscribers",
"subscription_url": "https://api.github.com/repos/chakki-works/typot-demo/subscription",
"commits_url": "https://api.github.com/repos/chakki-works/typot-demo/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/chakki-works/typot-demo/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/chakki-works/typot-demo/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/chakki-works/typot-demo/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/chakki-works/typot-demo/contents/{+path}",
"compare_url": "https://api.github.com/repos/chakki-works/typot-demo/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/chakki-works/typot-demo/merges",
"archive_url": "https://api.github.com/repos/chakki-works/typot-demo/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/chakki-works/typot-demo/downloads",
"issues_url": "https://api.github.com/repos/chakki-works/typot-demo/issues{/number}",
"pulls_url": "https://api.github.com/repos/chakki-works/typot-demo/pulls{/number}",
"milestones_url": "https://api.github.com/repos/chakki-works/typot-demo/milestones{/number}",
"notifications_url": "https://api.github.com/repos/chakki-works/typot-demo/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/chakki-works/typot-demo/labels{/name}",
"releases_url": "https://api.github.com/repos/chakki-works/typot-demo/releases{/id}",
"deployments_url": "https://api.github.com/repos/chakki-works/typot-demo/deployments",
"created_at": "2017-05-24T02:24:37Z",
"updated_at": "2017-05-24T02:24:37Z",
"pushed_at": "2017-05-24T07:05:39Z",
"git_url": "git://github.com/chakki-works/typot-demo.git",
"ssh_url": "git@github.com:chakki-works/typot-demo.git",
"clone_url": "https://github.com/chakki-works/typot-demo.git",
"svn_url": "https://github.com/chakki-works/typot-demo",
"homepage": null,
"size": 1,
"stargazers_count": 0,
"watchers_count": 0,
"language": null,
"has_issues": true,
"has_projects": true,
"has_downloads": true,
"has_wiki": true,
"has_pages": false,
"forks_count": 0,
"mirror_url": null,
"open_issues_count": 0,
"forks": 0,
"open_issues": 0,
"watchers": 0,
"default_branch": "master"
}
},
"base": {
"label": "chakki-works:master",
"ref": "master",
"sha": "a2573fb6cc5612219823765d0113938c666c1855",
"user": {
"login": "chakki-works",
"id": 25578516,
"avatar_url": "https://avatars0.githubusercontent.com/u/25578516?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/chakki-works",
"html_url": "https://github.com/chakki-works",
"followers_url": "https://api.github.com/users/chakki-works/followers",
"following_url": "https://api.github.com/users/chakki-works/following{/other_user}",
"gists_url": "https://api.github.com/users/chakki-works/gists{/gist_id}",
"starred_url": "https://api.github.com/users/chakki-works/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/chakki-works/subscriptions",
"organizations_url": "https://api.github.com/users/chakki-works/orgs",
"repos_url": "https://api.github.com/users/chakki-works/repos",
"events_url": "https://api.github.com/users/chakki-works/events{/privacy}",
"received_events_url": "https://api.github.com/users/chakki-works/received_events",
"type": "Organization",
"site_admin": false
},
"repo": {
"id": 92240778,
"name": "typot-demo",
"full_name": "chakki-works/typot-demo",
"owner": {
"login": "chakki-works",
"id": 25578516,
"avatar_url": "https://avatars0.githubusercontent.com/u/25578516?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/chakki-works",
"html_url": "https://github.com/chakki-works",
"followers_url": "https://api.github.com/users/chakki-works/followers",
"following_url": "https://api.github.com/users/chakki-works/following{/other_user}",
"gists_url": "https://api.github.com/users/chakki-works/gists{/gist_id}",
"starred_url": "https://api.github.com/users/chakki-works/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/chakki-works/subscriptions",
"organizations_url": "https://api.github.com/users/chakki-works/orgs",
"repos_url": "https://api.github.com/users/chakki-works/repos",
"events_url": "https://api.github.com/users/chakki-works/events{/privacy}",
"received_events_url": "https://api.github.com/users/chakki-works/received_events",
"type": "Organization",
"site_admin": false
},
"private": false,
"html_url": "https://github.com/chakki-works/typot-demo",
"description": "to test typot",
"fork": false,
"url": "https://api.github.com/repos/chakki-works/typot-demo",
"forks_url": "https://api.github.com/repos/chakki-works/typot-demo/forks",
"keys_url": "https://api.github.com/repos/chakki-works/typot-demo/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/chakki-works/typot-demo/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/chakki-works/typot-demo/teams",
"hooks_url": "https://api.github.com/repos/chakki-works/typot-demo/hooks",
"issue_events_url": "https://api.github.com/repos/chakki-works/typot-demo/issues/events{/number}",
"events_url": "https://api.github.com/repos/chakki-works/typot-demo/events",
"assignees_url": "https://api.github.com/repos/chakki-works/typot-demo/assignees{/user}",
"branches_url": "https://api.github.com/repos/chakki-works/typot-demo/branches{/branch}",
"tags_url": "https://api.github.com/repos/chakki-works/typot-demo/tags",
"blobs_url": "https://api.github.com/repos/chakki-works/typot-demo/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/chakki-works/typot-demo/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/chakki-works/typot-demo/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/chakki-works/typot-demo/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/chakki-works/typot-demo/statuses/{sha}",
"languages_url": "https://api.github.com/repos/chakki-works/typot-demo/languages",
"stargazers_url": "https://api.github.com/repos/chakki-works/typot-demo/stargazers",
"contributors_url": "https://api.github.com/repos/chakki-works/typot-demo/contributors",
"subscribers_url": "https://api.github.com/repos/chakki-works/typot-demo/subscribers",
"subscription_url": "https://api.github.com/repos/chakki-works/typot-demo/subscription",
"commits_url": "https://api.github.com/repos/chakki-works/typot-demo/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/chakki-works/typot-demo/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/chakki-works/typot-demo/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/chakki-works/typot-demo/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/chakki-works/typot-demo/contents/{+path}",
"compare_url": "https://api.github.com/repos/chakki-works/typot-demo/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/chakki-works/typot-demo/merges",
"archive_url": "https://api.github.com/repos/chakki-works/typot-demo/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/chakki-works/typot-demo/downloads",
"issues_url": "https://api.github.com/repos/chakki-works/typot-demo/issues{/number}",
"pulls_url": "https://api.github.com/repos/chakki-works/typot-demo/pulls{/number}",
"milestones_url": "https://api.github.com/repos/chakki-works/typot-demo/milestones{/number}",
"notifications_url": "https://api.github.com/repos/chakki-works/typot-demo/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/chakki-works/typot-demo/labels{/name}",
"releases_url": "https://api.github.com/repos/chakki-works/typot-demo/releases{/id}",
"deployments_url": "https://api.github.com/repos/chakki-works/typot-demo/deployments",
"created_at": "2017-05-24T02:24:37Z",
"updated_at": "2017-05-24T02:24:37Z",
"pushed_at": "2017-05-24T07:05:39Z",
"git_url": "git://github.com/chakki-works/typot-demo.git",
"ssh_url": "git@github.com:chakki-works/typot-demo.git",
"clone_url": "https://github.com/chakki-works/typot-demo.git",
"svn_url": "https://github.com/chakki-works/typot-demo",
"homepage": null,
"size": 1,
"stargazers_count": 0,
"watchers_count": 0,
"language": null,
"has_issues": true,
"has_projects": true,
"has_downloads": true,
"has_wiki": true,
"has_pages": false,
"forks_count": 0,
"mirror_url": null,
"open_issues_count": 0,
"forks": 0,
"open_issues": 0,
"watchers": 0,
"default_branch": "master"
}
},
"_links": {
"self": {
"href": "https://api.github.com/repos/chakki-works/typot-demo/pulls/2"
},
"html": {
"href": "https://github.com/chakki-works/typot-demo/pull/2"
},
"issue": {
"href": "https://api.github.com/repos/chakki-works/typot-demo/issues/2"
},
"comments": {
"href": "https://api.github.com/repos/chakki-works/typot-demo/issues/2/comments"
},
"review_comments": {
"href": "https://api.github.com/repos/chakki-works/typot-demo/pulls/2/comments"
},
"review_comment": {
"href": "https://api.github.com/repos/chakki-works/typot-demo/pulls/comments{/number}"
},
"commits": {
"href": "https://api.github.com/repos/chakki-works/typot-demo/pulls/2/commits"
},
"statuses": {
"href": "https://api.github.com/repos/chakki-works/typot-demo/statuses/2511e9cc5b0fa1f44feebc9c29d08304e7744269"
}
},
"merged": true,
"mergeable": null,
"rebaseable": null,
"mergeable_state": "unknown",
"merged_by": {
"login": "icoxfog417",
"id": 544269,
"avatar_url": "https://avatars3.githubusercontent.com/u/544269?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/icoxfog417",
"html_url": "https://github.com/icoxfog417",
"followers_url": "https://api.github.com/users/icoxfog417/followers",
"following_url": "https://api.github.com/users/icoxfog417/following{/other_user}",
"gists_url": "https://api.github.com/users/icoxfog417/gists{/gist_id}",
"starred_url": "https://api.github.com/users/icoxfog417/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/icoxfog417/subscriptions",
"organizations_url": "https://api.github.com/users/icoxfog417/orgs",
"repos_url": "https://api.github.com/users/icoxfog417/repos",
"events_url": "https://api.github.com/users/icoxfog417/events{/privacy}",
"received_events_url": "https://api.github.com/users/icoxfog417/received_events",
"type": "User",
"site_admin": false
},
"comments": 1,
"review_comments": 0,
"maintainer_can_modify": false,
"commits": 1,
"additions": 1,
"deletions": 1,
"changed_files": 1
},
"repository": {
"id": 92240778,
"name": "typot-demo",
"full_name": "chakki-works/typot-demo",
"owner": {
"login": "chakki-works",
"id": 25578516,
"avatar_url": "https://avatars0.githubusercontent.com/u/25578516?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/chakki-works",
"html_url": "https://github.com/chakki-works",
"followers_url": "https://api.github.com/users/chakki-works/followers",
"following_url": "https://api.github.com/users/chakki-works/following{/other_user}",
"gists_url": "https://api.github.com/users/chakki-works/gists{/gist_id}",
"starred_url": "https://api.github.com/users/chakki-works/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/chakki-works/subscriptions",
"organizations_url": "https://api.github.com/users/chakki-works/orgs",
"repos_url": "https://api.github.com/users/chakki-works/repos",
"events_url": "https://api.github.com/users/chakki-works/events{/privacy}",
"received_events_url": "https://api.github.com/users/chakki-works/received_events",
"type": "Organization",
"site_admin": false
},
"private": false,
"html_url": "https://github.com/chakki-works/typot-demo",
"description": "to test typot",
"fork": false,
"url": "https://api.github.com/repos/chakki-works/typot-demo",
"forks_url": "https://api.github.com/repos/chakki-works/typot-demo/forks",
"keys_url": "https://api.github.com/repos/chakki-works/typot-demo/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/chakki-works/typot-demo/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/chakki-works/typot-demo/teams",
"hooks_url": "https://api.github.com/repos/chakki-works/typot-demo/hooks",
"issue_events_url": "https://api.github.com/repos/chakki-works/typot-demo/issues/events{/number}",
"events_url": "https://api.github.com/repos/chakki-works/typot-demo/events",
"assignees_url": "https://api.github.com/repos/chakki-works/typot-demo/assignees{/user}",
"branches_url": "https://api.github.com/repos/chakki-works/typot-demo/branches{/branch}",
"tags_url": "https://api.github.com/repos/chakki-works/typot-demo/tags",
"blobs_url": "https://api.github.com/repos/chakki-works/typot-demo/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/chakki-works/typot-demo/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/chakki-works/typot-demo/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/chakki-works/typot-demo/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/chakki-works/typot-demo/statuses/{sha}",
"languages_url": "https://api.github.com/repos/chakki-works/typot-demo/languages",
"stargazers_url": "https://api.github.com/repos/chakki-works/typot-demo/stargazers",
"contributors_url": "https://api.github.com/repos/chakki-works/typot-demo/contributors",
"subscribers_url": "https://api.github.com/repos/chakki-works/typot-demo/subscribers",
"subscription_url": "https://api.github.com/repos/chakki-works/typot-demo/subscription",
"commits_url": "https://api.github.com/repos/chakki-works/typot-demo/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/chakki-works/typot-demo/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/chakki-works/typot-demo/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/chakki-works/typot-demo/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/chakki-works/typot-demo/contents/{+path}",
"compare_url": "https://api.github.com/repos/chakki-works/typot-demo/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/chakki-works/typot-demo/merges",
"archive_url": "https://api.github.com/repos/chakki-works/typot-demo/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/chakki-works/typot-demo/downloads",
"issues_url": "https://api.github.com/repos/chakki-works/typot-demo/issues{/number}",
"pulls_url": "https://api.github.com/repos/chakki-works/typot-demo/pulls{/number}",
"milestones_url": "https://api.github.com/repos/chakki-works/typot-demo/milestones{/number}",
"notifications_url": "https://api.github.com/repos/chakki-works/typot-demo/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/chakki-works/typot-demo/labels{/name}",
"releases_url": "https://api.github.com/repos/chakki-works/typot-demo/releases{/id}",
"deployments_url": "https://api.github.com/repos/chakki-works/typot-demo/deployments",
"created_at": "2017-05-24T02:24:37Z",
"updated_at": "2017-05-24T02:24:37Z",
"pushed_at": "2017-05-24T07:05:39Z",
"git_url": "git://github.com/chakki-works/typot-demo.git",
"ssh_url": "git@github.com:chakki-works/typot-demo.git",
"clone_url": "https://github.com/chakki-works/typot-demo.git",
"svn_url": "https://github.com/chakki-works/typot-demo",
"homepage": null,
"size": 1,
"stargazers_count": 0,
"watchers_count": 0,
"language": null,
"has_issues": true,
"has_projects": true,
"has_downloads": true,
"has_wiki": true,
"has_pages": false,
"forks_count": 0,
"mirror_url": null,
"open_issues_count": 0,
"forks": 0,
"open_issues": 0,
"watchers": 0,
"default_branch": "master"
},
"organization": {
"login": "chakki-works",
"id": 25578516,
"url": "https://api.github.com/orgs/chakki-works",
"repos_url": "https://api.github.com/orgs/chakki-works/repos",
"events_url": "https://api.github.com/orgs/chakki-works/events",
"hooks_url": "https://api.github.com/orgs/chakki-works/hooks",
"issues_url": "https://api.github.com/orgs/chakki-works/issues",
"members_url": "https://api.github.com/orgs/chakki-works/members{/member}",
"public_members_url": "https://api.github.com/orgs/chakki-works/public_members{/member}",
"avatar_url": "https://avatars0.githubusercontent.com/u/25578516?v=3",
"description": "Our mission is to enable everyone leave the office by the tea time"
},
"sender": {
"login": "icoxfog417",
"id": 544269,
"avatar_url": "https://avatars3.githubusercontent.com/u/544269?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/icoxfog417",
"html_url": "https://github.com/icoxfog417",
"followers_url": "https://api.github.com/users/icoxfog417/followers",
"following_url": "https://api.github.com/users/icoxfog417/following{/other_user}",
"gists_url": "https://api.github.com/users/icoxfog417/gists{/gist_id}",
"starred_url": "https://api.github.com/users/icoxfog417/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/icoxfog417/subscriptions",
"organizations_url": "https://api.github.com/users/icoxfog417/orgs",
"repos_url": "https://api.github.com/users/icoxfog417/repos",
"events_url": "https://api.github.com/users/icoxfog417/events{/privacy}",
"received_events_url": "https://api.github.com/users/icoxfog417/received_events",
"type": "User",
"site_admin": false
},
"installation": {
"id": 11111
}
}
"""
review_changed = r"""
{
"action": "edited",
"changes": {
"body": {
"from": "\"hoge\" is typo? \n- [ ] hoge-1\n- [ ] hoge-2\n- [ ] hoge-3"
}
},
"comment": {
"url": "https://api.github.com/repos/chakki-works/typot-demo/pulls/comments/118856819",
"pull_request_review_id": 40687574,
"id": 118856819,
"diff_hunk": "@@ -1,2 +1,7 @@\n # typot-demo",
"path": "README.md",
"position": 1,
"original_position": 1,
"commit_id": "adbdfa392e0cab7766dbcae6cee82bf5fd11a471",
"original_commit_id": "adbdfa392e0cab7766dbcae6cee82bf5fd11a471",
"user": {
"login": "typot[bot]",
"id": 28912751,
"avatar_url": "https://avatars0.githubusercontent.com/u/25578516?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/typot%5Bbot%5D",
"html_url": "https://github.com/apps/typot",
"followers_url": "https://api.github.com/users/typot%5Bbot%5D/followers",
"following_url": "https://api.github.com/users/typot%5Bbot%5D/following{/other_user}",
"gists_url": "https://api.github.com/users/typot%5Bbot%5D/gists{/gist_id}",
"starred_url": "https://api.github.com/users/typot%5Bbot%5D/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/typot%5Bbot%5D/subscriptions",
"organizations_url": "https://api.github.com/users/typot%5Bbot%5D/orgs",
"repos_url": "https://api.github.com/users/typot%5Bbot%5D/repos",
"events_url": "https://api.github.com/users/typot%5Bbot%5D/events{/privacy}",
"received_events_url": "https://api.github.com/users/typot%5Bbot%5D/received_events",
"type": "Bot",
"site_admin": false
},
"body": "\"hoge\" is typo? \n- [ ] hoge-1\n- [x] hoge-2\n- [ ] hoge-3",
"created_at": "2017-05-29T01:59:50Z",
"updated_at": "2017-05-29T01:59:50Z",
"html_url": "https://github.com/chakki-works/typot-demo/pull/3#discussion_r118856819",
"pull_request_url": "https://api.github.com/repos/chakki-works/typot-demo/pulls/3",
"_links": {
"self": {
"href": "https://api.github.com/repos/chakki-works/typot-demo/pulls/comments/118856819"
},
"html": {
"href": "https://github.com/chakki-works/typot-demo/pull/3#discussion_r118856819"
},
"pull_request": {
"href": "https://api.github.com/repos/chakki-works/typot-demo/pulls/3"
}
}
},
"pull_request": {
"url": "https://api.github.com/repos/chakki-works/typot-demo/pulls/3",
"id": 122168599,
"html_url": "https://github.com/chakki-works/typot-demo/pull/3",
"diff_url": "https://github.com/chakki-works/typot-demo/pull/3.diff",
"patch_url": "https://github.com/chakki-works/typot-demo/pull/3.patch",
"issue_url": "https://api.github.com/repos/chakki-works/typot-demo/issues/3",
"number": 3,
"state": "open",
"locked": false,
"title": "Update README.md",
"user": {
"login": "icoxfog417",
"id": 544269,
"avatar_url": "https://avatars3.githubusercontent.com/u/544269?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/icoxfog417",
"html_url": "https://github.com/icoxfog417",
"followers_url": "https://api.github.com/users/icoxfog417/followers",
"following_url": "https://api.github.com/users/icoxfog417/following{/other_user}",
"gists_url": "https://api.github.com/users/icoxfog417/gists{/gist_id}",
"starred_url": "https://api.github.com/users/icoxfog417/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/icoxfog417/subscriptions",
"organizations_url": "https://api.github.com/users/icoxfog417/orgs",
"repos_url": "https://api.github.com/users/icoxfog417/repos",
"events_url": "https://api.github.com/users/icoxfog417/events{/privacy}",
"received_events_url": "https://api.github.com/users/icoxfog417/received_events",
"type": "User",
"site_admin": false
},
"body": "Update README.md description",
"created_at": "2017-05-24T08:12:08Z",
"updated_at": "2017-05-29T02:00:04Z",
"closed_at": null,
"merged_at": null,
"merge_commit_sha": "1ccc304340b7d8d062b256dc48294acbb7991bdd",
"assignee": {
"login": "icoxfog417",
"id": 544269,
"avatar_url": "https://avatars3.githubusercontent.com/u/544269?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/icoxfog417",
"html_url": "https://github.com/icoxfog417",
"followers_url": "https://api.github.com/users/icoxfog417/followers",
"following_url": "https://api.github.com/users/icoxfog417/following{/other_user}",
"gists_url": "https://api.github.com/users/icoxfog417/gists{/gist_id}",
"starred_url": "https://api.github.com/users/icoxfog417/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/icoxfog417/subscriptions",
"organizations_url": "https://api.github.com/users/icoxfog417/orgs",
"repos_url": "https://api.github.com/users/icoxfog417/repos",
"events_url": "https://api.github.com/users/icoxfog417/events{/privacy}",
"received_events_url": "https://api.github.com/users/icoxfog417/received_events",
"type": "User",
"site_admin": false
},
"assignees": [
{
"login": "icoxfog417",
"id": 544269,
"avatar_url": "https://avatars3.githubusercontent.com/u/544269?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/icoxfog417",
"html_url": "https://github.com/icoxfog417",
"followers_url": "https://api.github.com/users/icoxfog417/followers",
"following_url": "https://api.github.com/users/icoxfog417/following{/other_user}",
"gists_url": "https://api.github.com/users/icoxfog417/gists{/gist_id}",
"starred_url": "https://api.github.com/users/icoxfog417/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/icoxfog417/subscriptions",
"organizations_url": "https://api.github.com/users/icoxfog417/orgs",
"repos_url": "https://api.github.com/users/icoxfog417/repos",
"events_url": "https://api.github.com/users/icoxfog417/events{/privacy}",
"received_events_url": "https://api.github.com/users/icoxfog417/received_events",
"type": "User",
"site_admin": false
}
],
"requested_reviewers": [
],
"milestone": null,
"commits_url": "https://api.github.com/repos/chakki-works/typot-demo/pulls/3/commits",
"review_comments_url": "https://api.github.com/repos/chakki-works/typot-demo/pulls/3/comments",
"review_comment_url": "https://api.github.com/repos/chakki-works/typot-demo/pulls/comments{/number}",
"comments_url": "https://api.github.com/repos/chakki-works/typot-demo/issues/3/comments",
"statuses_url": "https://api.github.com/repos/chakki-works/typot-demo/statuses/adbdfa392e0cab7766dbcae6cee82bf5fd11a471",
"head": {
"label": "chakki-works:dev",
"ref": "dev",
"sha": "adbdfa392e0cab7766dbcae6cee82bf5fd11a471",
"user": {
"login": "chakki-works",
"id": 25578516,
"avatar_url": "https://avatars0.githubusercontent.com/u/25578516?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/chakki-works",
"html_url": "https://github.com/chakki-works",
"followers_url": "https://api.github.com/users/chakki-works/followers",
"following_url": "https://api.github.com/users/chakki-works/following{/other_user}",
"gists_url": "https://api.github.com/users/chakki-works/gists{/gist_id}",
"starred_url": "https://api.github.com/users/chakki-works/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/chakki-works/subscriptions",
"organizations_url": "https://api.github.com/users/chakki-works/orgs",
"repos_url": "https://api.github.com/users/chakki-works/repos",
"events_url": "https://api.github.com/users/chakki-works/events{/privacy}",
"received_events_url": "https://api.github.com/users/chakki-works/received_events",
"type": "Organization",
"site_admin": false
},
"repo": {
"id": 92240778,
"name": "typot-demo",
"full_name": "chakki-works/typot-demo",
"owner": {
"login": "chakki-works",
"id": 25578516,
"avatar_url": "https://avatars0.githubusercontent.com/u/25578516?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/chakki-works",
"html_url": "https://github.com/chakki-works",
"followers_url": "https://api.github.com/users/chakki-works/followers",
"following_url": "https://api.github.com/users/chakki-works/following{/other_user}",
"gists_url": "https://api.github.com/users/chakki-works/gists{/gist_id}",
"starred_url": "https://api.github.com/users/chakki-works/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/chakki-works/subscriptions",
"organizations_url": "https://api.github.com/users/chakki-works/orgs",
"repos_url": "https://api.github.com/users/chakki-works/repos",
"events_url": "https://api.github.com/users/chakki-works/events{/privacy}",
"received_events_url": "https://api.github.com/users/chakki-works/received_events",
"type": "Organization",
"site_admin": false
},
"private": false,
"html_url": "https://github.com/chakki-works/typot-demo",
"description": "to test typot",
"fork": false,
"url": "https://api.github.com/repos/chakki-works/typot-demo",
"forks_url": "https://api.github.com/repos/chakki-works/typot-demo/forks",
"keys_url": "https://api.github.com/repos/chakki-works/typot-demo/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/chakki-works/typot-demo/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/chakki-works/typot-demo/teams",
"hooks_url": "https://api.github.com/repos/chakki-works/typot-demo/hooks",
"issue_events_url": "https://api.github.com/repos/chakki-works/typot-demo/issues/events{/number}",
"events_url": "https://api.github.com/repos/chakki-works/typot-demo/events",
"assignees_url": "https://api.github.com/repos/chakki-works/typot-demo/assignees{/user}",
"branches_url": "https://api.github.com/repos/chakki-works/typot-demo/branches{/branch}",
"tags_url": "https://api.github.com/repos/chakki-works/typot-demo/tags",
"blobs_url": "https://api.github.com/repos/chakki-works/typot-demo/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/chakki-works/typot-demo/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/chakki-works/typot-demo/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/chakki-works/typot-demo/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/chakki-works/typot-demo/statuses/{sha}",
"languages_url": "https://api.github.com/repos/chakki-works/typot-demo/languages",
"stargazers_url": "https://api.github.com/repos/chakki-works/typot-demo/stargazers",
"contributors_url": "https://api.github.com/repos/chakki-works/typot-demo/contributors",
"subscribers_url": "https://api.github.com/repos/chakki-works/typot-demo/subscribers",
"subscription_url": "https://api.github.com/repos/chakki-works/typot-demo/subscription",
"commits_url": "https://api.github.com/repos/chakki-works/typot-demo/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/chakki-works/typot-demo/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/chakki-works/typot-demo/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/chakki-works/typot-demo/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/chakki-works/typot-demo/contents/{+path}",
"compare_url": "https://api.github.com/repos/chakki-works/typot-demo/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/chakki-works/typot-demo/merges",
"archive_url": "https://api.github.com/repos/chakki-works/typot-demo/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/chakki-works/typot-demo/downloads",
"issues_url": "https://api.github.com/repos/chakki-works/typot-demo/issues{/number}",
"pulls_url": "https://api.github.com/repos/chakki-works/typot-demo/pulls{/number}",
"milestones_url": "https://api.github.com/repos/chakki-works/typot-demo/milestones{/number}",
"notifications_url": "https://api.github.com/repos/chakki-works/typot-demo/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/chakki-works/typot-demo/labels{/name}",
"releases_url": "https://api.github.com/repos/chakki-works/typot-demo/releases{/id}",
"deployments_url": "https://api.github.com/repos/chakki-works/typot-demo/deployments",
"created_at": "2017-05-24T02:24:37Z",
"updated_at": "2017-05-24T02:24:37Z",
"pushed_at": "2017-05-24T08:12:08Z",
"git_url": "git://github.com/chakki-works/typot-demo.git",
"ssh_url": "git@github.com:chakki-works/typot-demo.git",
"clone_url": "https://github.com/chakki-works/typot-demo.git",
"svn_url": "https://github.com/chakki-works/typot-demo",
"homepage": null,
"size": 2,
"stargazers_count": 0,
"watchers_count": 0,
"language": null,
"has_issues": true,
"has_projects": true,
"has_downloads": true,
"has_wiki": true,
"has_pages": false,
"forks_count": 0,
"mirror_url": null,
"open_issues_count": 1,
"forks": 0,
"open_issues": 1,
"watchers": 0,
"default_branch": "master"
}
},
"base": {
"label": "chakki-works:master",
"ref": "master",
"sha": "7d895e85cddbb7b0adf976d14ef717f2617a6876",
"user": {
"login": "chakki-works",
"id": 25578516,
"avatar_url": "https://avatars0.githubusercontent.com/u/25578516?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/chakki-works",
"html_url": "https://github.com/chakki-works",
"followers_url": "https://api.github.com/users/chakki-works/followers",
"following_url": "https://api.github.com/users/chakki-works/following{/other_user}",
"gists_url": "https://api.github.com/users/chakki-works/gists{/gist_id}",
"starred_url": "https://api.github.com/users/chakki-works/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/chakki-works/subscriptions",
"organizations_url": "https://api.github.com/users/chakki-works/orgs",
"repos_url": "https://api.github.com/users/chakki-works/repos",
"events_url": "https://api.github.com/users/chakki-works/events{/privacy}",
"received_events_url": "https://api.github.com/users/chakki-works/received_events",
"type": "Organization",
"site_admin": false
},
"repo": {
"id": 92240778,
"name": "typot-demo",
"full_name": "chakki-works/typot-demo",
"owner": {
"login": "chakki-works",
"id": 25578516,
"avatar_url": "https://avatars0.githubusercontent.com/u/25578516?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/chakki-works",
"html_url": "https://github.com/chakki-works",
"followers_url": "https://api.github.com/users/chakki-works/followers",
"following_url": "https://api.github.com/users/chakki-works/following{/other_user}",
"gists_url": "https://api.github.com/users/chakki-works/gists{/gist_id}",
"starred_url": "https://api.github.com/users/chakki-works/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/chakki-works/subscriptions",
"organizations_url": "https://api.github.com/users/chakki-works/orgs",
"repos_url": "https://api.github.com/users/chakki-works/repos",
"events_url": "https://api.github.com/users/chakki-works/events{/privacy}",
"received_events_url": "https://api.github.com/users/chakki-works/received_events",
"type": "Organization",
"site_admin": false
},
"private": false,
"html_url": "https://github.com/chakki-works/typot-demo",
"description": "to test typot",
"fork": false,
"url": "https://api.github.com/repos/chakki-works/typot-demo",
"forks_url": "https://api.github.com/repos/chakki-works/typot-demo/forks",
"keys_url": "https://api.github.com/repos/chakki-works/typot-demo/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/chakki-works/typot-demo/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/chakki-works/typot-demo/teams",
"hooks_url": "https://api.github.com/repos/chakki-works/typot-demo/hooks",
"issue_events_url": "https://api.github.com/repos/chakki-works/typot-demo/issues/events{/number}",
"events_url": "https://api.github.com/repos/chakki-works/typot-demo/events",
"assignees_url": "https://api.github.com/repos/chakki-works/typot-demo/assignees{/user}",
"branches_url": "https://api.github.com/repos/chakki-works/typot-demo/branches{/branch}",
"tags_url": "https://api.github.com/repos/chakki-works/typot-demo/tags",
"blobs_url": "https://api.github.com/repos/chakki-works/typot-demo/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/chakki-works/typot-demo/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/chakki-works/typot-demo/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/chakki-works/typot-demo/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/chakki-works/typot-demo/statuses/{sha}",
"languages_url": "https://api.github.com/repos/chakki-works/typot-demo/languages",
"stargazers_url": "https://api.github.com/repos/chakki-works/typot-demo/stargazers",
"contributors_url": "https://api.github.com/repos/chakki-works/typot-demo/contributors",
"subscribers_url": "https://api.github.com/repos/chakki-works/typot-demo/subscribers",
"subscription_url": "https://api.github.com/repos/chakki-works/typot-demo/subscription",
"commits_url": "https://api.github.com/repos/chakki-works/typot-demo/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/chakki-works/typot-demo/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/chakki-works/typot-demo/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/chakki-works/typot-demo/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/chakki-works/typot-demo/contents/{+path}",
"compare_url": "https://api.github.com/repos/chakki-works/typot-demo/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/chakki-works/typot-demo/merges",
"archive_url": "https://api.github.com/repos/chakki-works/typot-demo/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/chakki-works/typot-demo/downloads",
"issues_url": "https://api.github.com/repos/chakki-works/typot-demo/issues{/number}",
"pulls_url": "https://api.github.com/repos/chakki-works/typot-demo/pulls{/number}",
"milestones_url": "https://api.github.com/repos/chakki-works/typot-demo/milestones{/number}",
"notifications_url": "https://api.github.com/repos/chakki-works/typot-demo/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/chakki-works/typot-demo/labels{/name}",
"releases_url": "https://api.github.com/repos/chakki-works/typot-demo/releases{/id}",
"deployments_url": "https://api.github.com/repos/chakki-works/typot-demo/deployments",
"created_at": "2017-05-24T02:24:37Z",
"updated_at": "2017-05-24T02:24:37Z",
"pushed_at": "2017-05-24T08:12:08Z",
"git_url": "git://github.com/chakki-works/typot-demo.git",
"ssh_url": "git@github.com:chakki-works/typot-demo.git",
"clone_url": "https://github.com/chakki-works/typot-demo.git",
"svn_url": "https://github.com/chakki-works/typot-demo",
"homepage": null,
"size": 2,
"stargazers_count": 0,
"watchers_count": 0,
"language": null,
"has_issues": true,
"has_projects": true,
"has_downloads": true,
"has_wiki": true,
"has_pages": false,
"forks_count": 0,
"mirror_url": null,
"open_issues_count": 1,
"forks": 0,
"open_issues": 1,
"watchers": 0,
"default_branch": "master"
}
},
"_links": {
"self": {
"href": "https://api.github.com/repos/chakki-works/typot-demo/pulls/3"
},
"html": {
"href": "https://github.com/chakki-works/typot-demo/pull/3"
},
"issue": {
"href": "https://api.github.com/repos/chakki-works/typot-demo/issues/3"
},
"comments": {
"href": "https://api.github.com/repos/chakki-works/typot-demo/issues/3/comments"
},
"review_comments": {
"href": "https://api.github.com/repos/chakki-works/typot-demo/pulls/3/comments"
},
"review_comment": {
"href": "https://api.github.com/repos/chakki-works/typot-demo/pulls/comments{/number}"
},
"commits": {
"href": "https://api.github.com/repos/chakki-works/typot-demo/pulls/3/commits"
},
"statuses": {
"href": "https://api.github.com/repos/chakki-works/typot-demo/statuses/adbdfa392e0cab7766dbcae6cee82bf5fd11a471"
}
}
},
"repository": {
"id": 92240778,
"name": "typot-demo",
"full_name": "chakki-works/typot-demo",
"owner": {
"login": "chakki-works",
"id": 25578516,
"avatar_url": "https://avatars0.githubusercontent.com/u/25578516?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/chakki-works",
"html_url": "https://github.com/chakki-works",
"followers_url": "https://api.github.com/users/chakki-works/followers",
"following_url": "https://api.github.com/users/chakki-works/following{/other_user}",
"gists_url": "https://api.github.com/users/chakki-works/gists{/gist_id}",
"starred_url": "https://api.github.com/users/chakki-works/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/chakki-works/subscriptions",
"organizations_url": "https://api.github.com/users/chakki-works/orgs",
"repos_url": "https://api.github.com/users/chakki-works/repos",
"events_url": "https://api.github.com/users/chakki-works/events{/privacy}",
"received_events_url": "https://api.github.com/users/chakki-works/received_events",
"type": "Organization",
"site_admin": false
},
"private": false,
"html_url": "https://github.com/chakki-works/typot-demo",
"description": "to test typot",
"fork": false,
"url": "https://api.github.com/repos/chakki-works/typot-demo",
"forks_url": "https://api.github.com/repos/chakki-works/typot-demo/forks",
"keys_url": "https://api.github.com/repos/chakki-works/typot-demo/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/chakki-works/typot-demo/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/chakki-works/typot-demo/teams",
"hooks_url": "https://api.github.com/repos/chakki-works/typot-demo/hooks",
"issue_events_url": "https://api.github.com/repos/chakki-works/typot-demo/issues/events{/number}",
"events_url": "https://api.github.com/repos/chakki-works/typot-demo/events",
"assignees_url": "https://api.github.com/repos/chakki-works/typot-demo/assignees{/user}",
"branches_url": "https://api.github.com/repos/chakki-works/typot-demo/branches{/branch}",
"tags_url": "https://api.github.com/repos/chakki-works/typot-demo/tags",
"blobs_url": "https://api.github.com/repos/chakki-works/typot-demo/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/chakki-works/typot-demo/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/chakki-works/typot-demo/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/chakki-works/typot-demo/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/chakki-works/typot-demo/statuses/{sha}",
"languages_url": "https://api.github.com/repos/chakki-works/typot-demo/languages",
"stargazers_url": "https://api.github.com/repos/chakki-works/typot-demo/stargazers",
"contributors_url": "https://api.github.com/repos/chakki-works/typot-demo/contributors",
"subscribers_url": "https://api.github.com/repos/chakki-works/typot-demo/subscribers",
"subscription_url": "https://api.github.com/repos/chakki-works/typot-demo/subscription",
"commits_url": "https://api.github.com/repos/chakki-works/typot-demo/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/chakki-works/typot-demo/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/chakki-works/typot-demo/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/chakki-works/typot-demo/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/chakki-works/typot-demo/contents/{+path}",
"compare_url": "https://api.github.com/repos/chakki-works/typot-demo/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/chakki-works/typot-demo/merges",
"archive_url": "https://api.github.com/repos/chakki-works/typot-demo/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/chakki-works/typot-demo/downloads",
"issues_url": "https://api.github.com/repos/chakki-works/typot-demo/issues{/number}",
"pulls_url": "https://api.github.com/repos/chakki-works/typot-demo/pulls{/number}",
"milestones_url": "https://api.github.com/repos/chakki-works/typot-demo/milestones{/number}",
"notifications_url": "https://api.github.com/repos/chakki-works/typot-demo/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/chakki-works/typot-demo/labels{/name}",
"releases_url": "https://api.github.com/repos/chakki-works/typot-demo/releases{/id}",
"deployments_url": "https://api.github.com/repos/chakki-works/typot-demo/deployments",
"created_at": "2017-05-24T02:24:37Z",
"updated_at": "2017-05-24T02:24:37Z",
"pushed_at": "2017-05-24T08:12:08Z",
"git_url": "git://github.com/chakki-works/typot-demo.git",
"ssh_url": "git@github.com:chakki-works/typot-demo.git",
"clone_url": "https://github.com/chakki-works/typot-demo.git",
"svn_url": "https://github.com/chakki-works/typot-demo",
"homepage": null,
"size": 2,
"stargazers_count": 0,
"watchers_count": 0,
"language": null,
"has_issues": true,
"has_projects": true,
"has_downloads": true,
"has_wiki": true,
"has_pages": false,
"forks_count": 0,
"mirror_url": null,
"open_issues_count": 1,
"forks": 0,
"open_issues": 1,
"watchers": 0,
"default_branch": "master"
},
"organization": {
"login": "chakki-works",
"id": 25578516,
"url": "https://api.github.com/orgs/chakki-works",
"repos_url": "https://api.github.com/orgs/chakki-works/repos",
"events_url": "https://api.github.com/orgs/chakki-works/events",
"hooks_url": "https://api.github.com/orgs/chakki-works/hooks",
"issues_url": "https://api.github.com/orgs/chakki-works/issues",
"members_url": "https://api.github.com/orgs/chakki-works/members{/member}",
"public_members_url": "https://api.github.com/orgs/chakki-works/public_members{/member}",
"avatar_url": "https://avatars0.githubusercontent.com/u/25578516?v=3",
"description": "Our mission is to enable everyone leave the office by the tea time"
},
"sender": {
"login": "icoxfog417",
"id": 544269,
"avatar_url": "https://avatars3.githubusercontent.com/u/544269?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/icoxfog417",
"html_url": "https://github.com/icoxfog417",
"followers_url": "https://api.github.com/users/icoxfog417/followers",
"following_url": "https://api.github.com/users/icoxfog417/following{/other_user}",
"gists_url": "https://api.github.com/users/icoxfog417/gists{/gist_id}",
"starred_url": "https://api.github.com/users/icoxfog417/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/icoxfog417/subscriptions",
"organizations_url": "https://api.github.com/users/icoxfog417/orgs",
"repos_url": "https://api.github.com/users/icoxfog417/repos",
"events_url": "https://api.github.com/users/icoxfog417/events{/privacy}",
"received_events_url": "https://api.github.com/users/icoxfog417/received_events",
"type": "User",
"site_admin": false
},
"installation": {
"id": 11111
}
}
"""
fix_target_pr = r"""
{
"action": "opened",
"number": 4,
"pull_request": {
"url": "https://api.github.com/repos/chakki-works/typot-demo/pulls/4",
"id": 122827018,
"html_url": "https://github.com/chakki-works/typot-demo/pull/4",
"diff_url": "https://github.com/chakki-works/typot-demo/pull/4.diff",
"patch_url": "https://github.com/chakki-works/typot-demo/pull/4.patch",
"issue_url": "https://api.github.com/repos/chakki-works/typot-demo/issues/4",
"number": 4,
"state": "open",
"locked": false,
"title": "Typo exists in content.md",
"user": {
"login": "icoxfog417",
"id": 544269,
"avatar_url": "https://avatars3.githubusercontent.com/u/544269?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/icoxfog417",
"html_url": "https://github.com/icoxfog417",
"followers_url": "https://api.github.com/users/icoxfog417/followers",
"following_url": "https://api.github.com/users/icoxfog417/following{/other_user}",
"gists_url": "https://api.github.com/users/icoxfog417/gists{/gist_id}",
"starred_url": "https://api.github.com/users/icoxfog417/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/icoxfog417/subscriptions",
"organizations_url": "https://api.github.com/users/icoxfog417/orgs",
"repos_url": "https://api.github.com/users/icoxfog417/repos",
"events_url": "https://api.github.com/users/icoxfog417/events{/privacy}",
"received_events_url": "https://api.github.com/users/icoxfog417/received_events",
"type": "User",
"site_admin": false
},
"body": "",
"created_at": "2017-05-29T04:37:11Z",
"updated_at": "2017-05-29T04:37:11Z",
"closed_at": null,
"merged_at": null,
"merge_commit_sha": null,
"assignee": null,
"assignees": [
],
"requested_reviewers": [
],
"milestone": null,
"commits_url": "https://api.github.com/repos/chakki-works/typot-demo/pulls/4/commits",
"review_comments_url": "https://api.github.com/repos/chakki-works/typot-demo/pulls/4/comments",
"review_comment_url": "https://api.github.com/repos/chakki-works/typot-demo/pulls/comments{/number}",
"comments_url": "https://api.github.com/repos/chakki-works/typot-demo/issues/4/comments",
"statuses_url": "https://api.github.com/repos/chakki-works/typot-demo/statuses/f0d3ab26d259ef474996d22dcff21dfce6ca4492",
"head": {
"label": "chakki-works:content",
"ref": "content",
"sha": "f0d3ab26d259ef474996d22dcff21dfce6ca4492",
"user": {
"login": "chakki-works",
"id": 25578516,
"avatar_url": "https://avatars0.githubusercontent.com/u/25578516?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/chakki-works",
"html_url": "https://github.com/chakki-works",
"followers_url": "https://api.github.com/users/chakki-works/followers",
"following_url": "https://api.github.com/users/chakki-works/following{/other_user}",
"gists_url": "https://api.github.com/users/chakki-works/gists{/gist_id}",
"starred_url": "https://api.github.com/users/chakki-works/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/chakki-works/subscriptions",
"organizations_url": "https://api.github.com/users/chakki-works/orgs",
"repos_url": "https://api.github.com/users/chakki-works/repos",
"events_url": "https://api.github.com/users/chakki-works/events{/privacy}",
"received_events_url": "https://api.github.com/users/chakki-works/received_events",
"type": "Organization",
"site_admin": false
},
"repo": {
"id": 92240778,
"name": "typot-demo",
"full_name": "chakki-works/typot-demo",
"owner": {
"login": "chakki-works",
"id": 25578516,
"avatar_url": "https://avatars0.githubusercontent.com/u/25578516?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/chakki-works",
"html_url": "https://github.com/chakki-works",
"followers_url": "https://api.github.com/users/chakki-works/followers",
"following_url": "https://api.github.com/users/chakki-works/following{/other_user}",
"gists_url": "https://api.github.com/users/chakki-works/gists{/gist_id}",
"starred_url": "https://api.github.com/users/chakki-works/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/chakki-works/subscriptions",
"organizations_url": "https://api.github.com/users/chakki-works/orgs",
"repos_url": "https://api.github.com/users/chakki-works/repos",
"events_url": "https://api.github.com/users/chakki-works/events{/privacy}",
"received_events_url": "https://api.github.com/users/chakki-works/received_events",
"type": "Organization",
"site_admin": false
},
"private": false,
"html_url": "https://github.com/chakki-works/typot-demo",
"description": "to test typot",
"fork": false,
"url": "https://api.github.com/repos/chakki-works/typot-demo",
"forks_url": "https://api.github.com/repos/chakki-works/typot-demo/forks",
"keys_url": "https://api.github.com/repos/chakki-works/typot-demo/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/chakki-works/typot-demo/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/chakki-works/typot-demo/teams",
"hooks_url": "https://api.github.com/repos/chakki-works/typot-demo/hooks",
"issue_events_url": "https://api.github.com/repos/chakki-works/typot-demo/issues/events{/number}",
"events_url": "https://api.github.com/repos/chakki-works/typot-demo/events",
"assignees_url": "https://api.github.com/repos/chakki-works/typot-demo/assignees{/user}",
"branches_url": "https://api.github.com/repos/chakki-works/typot-demo/branches{/branch}",
"tags_url": "https://api.github.com/repos/chakki-works/typot-demo/tags",
"blobs_url": "https://api.github.com/repos/chakki-works/typot-demo/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/chakki-works/typot-demo/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/chakki-works/typot-demo/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/chakki-works/typot-demo/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/chakki-works/typot-demo/statuses/{sha}",
"languages_url": "https://api.github.com/repos/chakki-works/typot-demo/languages",
"stargazers_url": "https://api.github.com/repos/chakki-works/typot-demo/stargazers",
"contributors_url": "https://api.github.com/repos/chakki-works/typot-demo/contributors",
"subscribers_url": "https://api.github.com/repos/chakki-works/typot-demo/subscribers",
"subscription_url": "https://api.github.com/repos/chakki-works/typot-demo/subscription",
"commits_url": "https://api.github.com/repos/chakki-works/typot-demo/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/chakki-works/typot-demo/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/chakki-works/typot-demo/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/chakki-works/typot-demo/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/chakki-works/typot-demo/contents/{+path}",
"compare_url": "https://api.github.com/repos/chakki-works/typot-demo/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/chakki-works/typot-demo/merges",
"archive_url": "https://api.github.com/repos/chakki-works/typot-demo/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/chakki-works/typot-demo/downloads",
"issues_url": "https://api.github.com/repos/chakki-works/typot-demo/issues{/number}",
"pulls_url": "https://api.github.com/repos/chakki-works/typot-demo/pulls{/number}",
"milestones_url": "https://api.github.com/repos/chakki-works/typot-demo/milestones{/number}",
"notifications_url": "https://api.github.com/repos/chakki-works/typot-demo/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/chakki-works/typot-demo/labels{/name}",
"releases_url": "https://api.github.com/repos/chakki-works/typot-demo/releases{/id}",
"deployments_url": "https://api.github.com/repos/chakki-works/typot-demo/deployments",
"created_at": "2017-05-24T02:24:37Z",
"updated_at": "2017-05-24T02:24:37Z",
"pushed_at": "2017-05-29T04:36:46Z",
"git_url": "git://github.com/chakki-works/typot-demo.git",
"ssh_url": "git@github.com:chakki-works/typot-demo.git",
"clone_url": "https://github.com/chakki-works/typot-demo.git",
"svn_url": "https://github.com/chakki-works/typot-demo",
"homepage": null,
"size": 2,
"stargazers_count": 0,
"watchers_count": 0,
"language": null,
"has_issues": true,
"has_projects": true,
"has_downloads": true,
"has_wiki": true,
"has_pages": false,
"forks_count": 0,
"mirror_url": null,
"open_issues_count": 2,
"forks": 0,
"open_issues": 2,
"watchers": 0,
"default_branch": "master"
}
},
"base": {
"label": "chakki-works:master",
"ref": "master",
"sha": "5d85936b799357162921c646d596b32ba29e2717",
"user": {
"login": "chakki-works",
"id": 25578516,
"avatar_url": "https://avatars0.githubusercontent.com/u/25578516?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/chakki-works",
"html_url": "https://github.com/chakki-works",
"followers_url": "https://api.github.com/users/chakki-works/followers",
"following_url": "https://api.github.com/users/chakki-works/following{/other_user}",
"gists_url": "https://api.github.com/users/chakki-works/gists{/gist_id}",
"starred_url": "https://api.github.com/users/chakki-works/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/chakki-works/subscriptions",
"organizations_url": "https://api.github.com/users/chakki-works/orgs",
"repos_url": "https://api.github.com/users/chakki-works/repos",
"events_url": "https://api.github.com/users/chakki-works/events{/privacy}",
"received_events_url": "https://api.github.com/users/chakki-works/received_events",
"type": "Organization",
"site_admin": false
},
"repo": {
"id": 92240778,
"name": "typot-demo",
"full_name": "chakki-works/typot-demo",
"owner": {
"login": "chakki-works",
"id": 25578516,
"avatar_url": "https://avatars0.githubusercontent.com/u/25578516?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/chakki-works",
"html_url": "https://github.com/chakki-works",
"followers_url": "https://api.github.com/users/chakki-works/followers",
"following_url": "https://api.github.com/users/chakki-works/following{/other_user}",
"gists_url": "https://api.github.com/users/chakki-works/gists{/gist_id}",
"starred_url": "https://api.github.com/users/chakki-works/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/chakki-works/subscriptions",
"organizations_url": "https://api.github.com/users/chakki-works/orgs",
"repos_url": "https://api.github.com/users/chakki-works/repos",
"events_url": "https://api.github.com/users/chakki-works/events{/privacy}",
"received_events_url": "https://api.github.com/users/chakki-works/received_events",
"type": "Organization",
"site_admin": false
},
"private": false,
"html_url": "https://github.com/chakki-works/typot-demo",
"description": "to test typot",
"fork": false,
"url": "https://api.github.com/repos/chakki-works/typot-demo",
"forks_url": "https://api.github.com/repos/chakki-works/typot-demo/forks",
"keys_url": "https://api.github.com/repos/chakki-works/typot-demo/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/chakki-works/typot-demo/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/chakki-works/typot-demo/teams",
"hooks_url": "https://api.github.com/repos/chakki-works/typot-demo/hooks",
"issue_events_url": "https://api.github.com/repos/chakki-works/typot-demo/issues/events{/number}",
"events_url": "https://api.github.com/repos/chakki-works/typot-demo/events",
"assignees_url": "https://api.github.com/repos/chakki-works/typot-demo/assignees{/user}",
"branches_url": "https://api.github.com/repos/chakki-works/typot-demo/branches{/branch}",
"tags_url": "https://api.github.com/repos/chakki-works/typot-demo/tags",
"blobs_url": "https://api.github.com/repos/chakki-works/typot-demo/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/chakki-works/typot-demo/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/chakki-works/typot-demo/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/chakki-works/typot-demo/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/chakki-works/typot-demo/statuses/{sha}",
"languages_url": "https://api.github.com/repos/chakki-works/typot-demo/languages",
"stargazers_url": "https://api.github.com/repos/chakki-works/typot-demo/stargazers",
"contributors_url": "https://api.github.com/repos/chakki-works/typot-demo/contributors",
"subscribers_url": "https://api.github.com/repos/chakki-works/typot-demo/subscribers",
"subscription_url": "https://api.github.com/repos/chakki-works/typot-demo/subscription",
"commits_url": "https://api.github.com/repos/chakki-works/typot-demo/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/chakki-works/typot-demo/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/chakki-works/typot-demo/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/chakki-works/typot-demo/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/chakki-works/typot-demo/contents/{+path}",
"compare_url": "https://api.github.com/repos/chakki-works/typot-demo/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/chakki-works/typot-demo/merges",
"archive_url": "https://api.github.com/repos/chakki-works/typot-demo/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/chakki-works/typot-demo/downloads",
"issues_url": "https://api.github.com/repos/chakki-works/typot-demo/issues{/number}",
"pulls_url": "https://api.github.com/repos/chakki-works/typot-demo/pulls{/number}",
"milestones_url": "https://api.github.com/repos/chakki-works/typot-demo/milestones{/number}",
"notifications_url": "https://api.github.com/repos/chakki-works/typot-demo/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/chakki-works/typot-demo/labels{/name}",
"releases_url": "https://api.github.com/repos/chakki-works/typot-demo/releases{/id}",
"deployments_url": "https://api.github.com/repos/chakki-works/typot-demo/deployments",
"created_at": "2017-05-24T02:24:37Z",
"updated_at": "2017-05-24T02:24:37Z",
"pushed_at": "2017-05-29T04:36:46Z",
"git_url": "git://github.com/chakki-works/typot-demo.git",
"ssh_url": "git@github.com:chakki-works/typot-demo.git",
"clone_url": "https://github.com/chakki-works/typot-demo.git",
"svn_url": "https://github.com/chakki-works/typot-demo",
"homepage": null,
"size": 2,
"stargazers_count": 0,
"watchers_count": 0,
"language": null,
"has_issues": true,
"has_projects": true,
"has_downloads": true,
"has_wiki": true,
"has_pages": false,
"forks_count": 0,
"mirror_url": null,
"open_issues_count": 2,
"forks": 0,
"open_issues": 2,
"watchers": 0,
"default_branch": "master"
}
},
"_links": {
"self": {
"href": "https://api.github.com/repos/chakki-works/typot-demo/pulls/4"
},
"html": {
"href": "https://github.com/chakki-works/typot-demo/pull/4"
},
"issue": {
"href": "https://api.github.com/repos/chakki-works/typot-demo/issues/4"
},
"comments": {
"href": "https://api.github.com/repos/chakki-works/typot-demo/issues/4/comments"
},
"review_comments": {
"href": "https://api.github.com/repos/chakki-works/typot-demo/pulls/4/comments"
},
"review_comment": {
"href": "https://api.github.com/repos/chakki-works/typot-demo/pulls/comments{/number}"
},
"commits": {
"href": "https://api.github.com/repos/chakki-works/typot-demo/pulls/4/commits"
},
"statuses": {
"href": "https://api.github.com/repos/chakki-works/typot-demo/statuses/f0d3ab26d259ef474996d22dcff21dfce6ca4492"
}
},
"merged": false,
"mergeable": null,
"rebaseable": null,
"mergeable_state": "unknown",
"merged_by": null,
"comments": 0,
"review_comments": 0,
"maintainer_can_modify": false,
"commits": 1,
"additions": 2,
"deletions": 0,
"changed_files": 1
},
"repository": {
"id": 92240778,
"name": "typot-demo",
"full_name": "chakki-works/typot-demo",
"owner": {
"login": "chakki-works",
"id": 25578516,
"avatar_url": "https://avatars0.githubusercontent.com/u/25578516?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/chakki-works",
"html_url": "https://github.com/chakki-works",
"followers_url": "https://api.github.com/users/chakki-works/followers",
"following_url": "https://api.github.com/users/chakki-works/following{/other_user}",
"gists_url": "https://api.github.com/users/chakki-works/gists{/gist_id}",
"starred_url": "https://api.github.com/users/chakki-works/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/chakki-works/subscriptions",
"organizations_url": "https://api.github.com/users/chakki-works/orgs",
"repos_url": "https://api.github.com/users/chakki-works/repos",
"events_url": "https://api.github.com/users/chakki-works/events{/privacy}",
"received_events_url": "https://api.github.com/users/chakki-works/received_events",
"type": "Organization",
"site_admin": false
},
"private": false,
"html_url": "https://github.com/chakki-works/typot-demo",
"description": "to test typot",
"fork": false,
"url": "https://api.github.com/repos/chakki-works/typot-demo",
"forks_url": "https://api.github.com/repos/chakki-works/typot-demo/forks",
"keys_url": "https://api.github.com/repos/chakki-works/typot-demo/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/chakki-works/typot-demo/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/chakki-works/typot-demo/teams",
"hooks_url": "https://api.github.com/repos/chakki-works/typot-demo/hooks",
"issue_events_url": "https://api.github.com/repos/chakki-works/typot-demo/issues/events{/number}",
"events_url": "https://api.github.com/repos/chakki-works/typot-demo/events",
"assignees_url": "https://api.github.com/repos/chakki-works/typot-demo/assignees{/user}",
"branches_url": "https://api.github.com/repos/chakki-works/typot-demo/branches{/branch}",
"tags_url": "https://api.github.com/repos/chakki-works/typot-demo/tags",
"blobs_url": "https://api.github.com/repos/chakki-works/typot-demo/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/chakki-works/typot-demo/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/chakki-works/typot-demo/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/chakki-works/typot-demo/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/chakki-works/typot-demo/statuses/{sha}",
"languages_url": "https://api.github.com/repos/chakki-works/typot-demo/languages",
"stargazers_url": "https://api.github.com/repos/chakki-works/typot-demo/stargazers",
"contributors_url": "https://api.github.com/repos/chakki-works/typot-demo/contributors",
"subscribers_url": "https://api.github.com/repos/chakki-works/typot-demo/subscribers",
"subscription_url": "https://api.github.com/repos/chakki-works/typot-demo/subscription",
"commits_url": "https://api.github.com/repos/chakki-works/typot-demo/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/chakki-works/typot-demo/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/chakki-works/typot-demo/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/chakki-works/typot-demo/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/chakki-works/typot-demo/contents/{+path}",
"compare_url": "https://api.github.com/repos/chakki-works/typot-demo/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/chakki-works/typot-demo/merges",
"archive_url": "https://api.github.com/repos/chakki-works/typot-demo/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/chakki-works/typot-demo/downloads",
"issues_url": "https://api.github.com/repos/chakki-works/typot-demo/issues{/number}",
"pulls_url": "https://api.github.com/repos/chakki-works/typot-demo/pulls{/number}",
"milestones_url": "https://api.github.com/repos/chakki-works/typot-demo/milestones{/number}",
"notifications_url": "https://api.github.com/repos/chakki-works/typot-demo/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/chakki-works/typot-demo/labels{/name}",
"releases_url": "https://api.github.com/repos/chakki-works/typot-demo/releases{/id}",
"deployments_url": "https://api.github.com/repos/chakki-works/typot-demo/deployments",
"created_at": "2017-05-24T02:24:37Z",
"updated_at": "2017-05-24T02:24:37Z",
"pushed_at": "2017-05-29T04:36:46Z",
"git_url": "git://github.com/chakki-works/typot-demo.git",
"ssh_url": "git@github.com:chakki-works/typot-demo.git",
"clone_url": "https://github.com/chakki-works/typot-demo.git",
"svn_url": "https://github.com/chakki-works/typot-demo",
"homepage": null,
"size": 2,
"stargazers_count": 0,
"watchers_count": 0,
"language": null,
"has_issues": true,
"has_projects": true,
"has_downloads": true,
"has_wiki": true,
"has_pages": false,
"forks_count": 0,
"mirror_url": null,
"open_issues_count": 2,
"forks": 0,
"open_issues": 2,
"watchers": 0,
"default_branch": "master"
},
"organization": {
"login": "chakki-works",
"id": 25578516,
"url": "https://api.github.com/orgs/chakki-works",
"repos_url": "https://api.github.com/orgs/chakki-works/repos",
"events_url": "https://api.github.com/orgs/chakki-works/events",
"hooks_url": "https://api.github.com/orgs/chakki-works/hooks",
"issues_url": "https://api.github.com/orgs/chakki-works/issues",
"members_url": "https://api.github.com/orgs/chakki-works/members{/member}",
"public_members_url": "https://api.github.com/orgs/chakki-works/public_members{/member}",
"avatar_url": "https://avatars0.githubusercontent.com/u/25578516?v=3",
"description": "Our mission is to enable everyone leave the office by the tea time"
},
"sender": {
"login": "icoxfog417",
"id": 544269,
"avatar_url": "https://avatars3.githubusercontent.com/u/544269?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/icoxfog417",
"html_url": "https://github.com/icoxfog417",
"followers_url": "https://api.github.com/users/icoxfog417/followers",
"following_url": "https://api.github.com/users/icoxfog417/following{/other_user}",
"gists_url": "https://api.github.com/users/icoxfog417/gists{/gist_id}",
"starred_url": "https://api.github.com/users/icoxfog417/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/icoxfog417/subscriptions",
"organizations_url": "https://api.github.com/users/icoxfog417/orgs",
"repos_url": "https://api.github.com/users/icoxfog417/repos",
"events_url": "https://api.github.com/users/icoxfog417/events{/privacy}",
"received_events_url": "https://api.github.com/users/icoxfog417/received_events",
"type": "User",
"site_admin": false
},
"installation": {
"id": 11111
}
}
"""
diff_sample = """
diff --git a/content.md b/content.md
index b7ab025..67ea8f3 100644
--- a/content.md
+++ b/content.md
@@ -1,5 +1,7 @@
# Typot Demo Content
* Now release humans from checking the typos
-* Now relase humans from checking the typos
+* Now release humans from checking the typos
* Now release humans fram checkingg the typos
+
+ohh, typos!
"""
diff_from_middle = """
diff --git a/README.md b/README.md
index dc3326a..ab9eb25 100644
--- a/README.md
+++ b/README.md
@@ -3,3 +3,5 @@
Typot automatically detect & fix typo!
You can try its feature on this repository.
+
+I made mistoke here.
"""
================================================
FILE: tests/get_installation_id.py
================================================
import os
import json
def get():
path = os.path.join(os.path.dirname(__file__), "./test_installation_id.json")
if not os.path.exists(path):
raise Exception(
"You have to prepare test_installation_id.json in tests folder. \n That has 'installation_id': (your test app's installation id)"
)
installation_id = ""
with open(path, encoding="utf-8") as f:
body = json.load(f)
installation_id = body["installation_id"]
return installation_id
================================================
FILE: tests/test_diff_content.py
================================================
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), "../"))
import unittest
from typot.pull_request import PullRequest
from typot.model import DiffContent, Line
import dummy_data as dd
class TestDiffContent(unittest.TestCase):
def test_get_added(self):
sample_diff = dd.diff_sample
diff_contents = PullRequest._get_added(sample_diff)
self.assertEqual(len(diff_contents), 1)
modified = diff_contents[0]
self.assertEqual(len(modified.contents), 3)
def test_line_position(self):
sample_diff = dd.diff_from_middle
diff_contents = PullRequest._get_added(sample_diff)
self.assertEqual(len(diff_contents), 1)
line = diff_contents[0].contents[-1]
self.assertEqual(line.line_no, 7)
self.assertEqual(line.relative_no, 5)
if __name__ == "__main__":
unittest.main()
================================================
FILE: tests/test_env.py
================================================
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), "../"))
import unittest
import typot.env as env
class TestEnv(unittest.TestCase):
def test_private_key(self):
pem = env.get_private_pem()
self.assertTrue(pem)
def test_client_id_secret(self):
client_id = env.get_client_id()
client_secret = env.get_client_secret()
self.assertTrue(client_id)
self.assertTrue(client_secret)
if __name__ == "__main__":
unittest.main()
================================================
FILE: tests/test_pull_request.py
================================================
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), "../"))
import json
import unittest
from typot.pull_request import PullRequest
from typot.model import Modification
import dummy_data as dd
import get_installation_id
INSTALLATION_ID = get_installation_id.get()
class TestPullRequest(unittest.TestCase):
def test_create_instance(self):
pr_body = json.loads(dd.pull_request_created)
pr = PullRequest.create_from_hook(pr_body)
self.assertTrue(pr.title)
self.assertTrue(pr.diff_url)
def test_get_added(self):
pr_body = json.loads(dd.pull_request_created)
pr = PullRequest.create_from_hook(pr_body)
diff_contents = pr.get_added()
print(diff_contents)
self.assertEqual(len(diff_contents), 1)
def test_make_review(self):
pr = PullRequest.create("chakki-works", "typot-demo", "3")
pr.installation_id = INSTALLATION_ID
m = Modification("README.md", 1, "hoge", ["hoge-1", "hoge-2", "hoge-3"])
r_id = pr.make_review([m])
self.assertTrue(r_id)
# you have to delete yourself!
def test_read_modification(self):
comment_hook_body = json.loads(dd.review_changed)
pr = PullRequest.create_from_hook(comment_hook_body)
modification = pr.read_modification(comment_hook_body)
self.assertTrue(modification)
self.assertEqual(modification.target_word, "hoge")
self.assertEqual(modification.candidates[0], "hoge-2")
def test_push_modification(self):
pr_body = json.loads(dd.fix_target_pr)
pr = PullRequest.create_from_hook(pr_body)
pr.installation_id = INSTALLATION_ID
m = Modification("content.md", 3, "relase", ["release"])
pr.push_modification(m)
if __name__ == "__main__":
unittest.main()
================================================
FILE: tests/test_spell_checker.py
================================================
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), "../"))
import unittest
from typot.model import DiffContent, Line
from typot.spell_checker import SpellChecker
class TestSpellChecker(unittest.TestCase):
def test_spell_check(self):
s = "My name iss John. I'm aesome singer."
checker = SpellChecker()
missed = checker.check(s)
self.assertGreater(len(missed), 0)
print(missed)
def test_spell_check(self):
f1 = DiffContent("test1.md", [
Line(0, "I'm John."),
Line(1, "I'm awesme singer."),
Line(2, "Singer mst be star."),
])
checker = SpellChecker()
missed = checker.check(f1)
self.assertGreater(len(missed), 0)
print(missed)
if __name__ == "__main__":
unittest.main()
================================================
FILE: typot/__init__.py
================================================
================================================
FILE: typot/api.py
================================================
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), "../"))
import hug
from typot.pull_request import PullRequest
from typot.spell_checker import SpellChecker
version = 1
@hug.get("/ping", versions=version)
@hug.local()
def ping():
return {"ping": "works fine!"}
@hug.post("/typot", versions=version)
@hug.local()
def typot(body=None):
if not body:
return {}
response = {}
if body["action"] == "opened" and "pull_request" in body:
# open the pull request
pr = PullRequest.create_from_hook(body)
diff_contents = pr.get_added()
diff_contents = [df for df in diff_contents if is_target_content(df.file_path)]
checker = SpellChecker()
modifications = []
for c in diff_contents:
file_modifications = checker.check(c)
if len(file_modifications) > 0:
modifications += file_modifications
if len(modifications) > 0:
pr.make_review(modifications)
response = {"message": "create pull request review"}
elif body["action"] == "edited" and "pull_request" in body and "comment" in body:
commented_user = body["comment"]["user"]["login"]
if commented_user == "typot[bot]":
pr = PullRequest.create_from_hook(body)
modification = pr.read_modification(body)
if modification:
result = pr.push_modification(modification)
if result:
response = {"message": "apply modification"}
else:
response = {"message": "apply is not adopted"}
return response
def is_target_content(file_path):
file_name = os.path.basename(file_path)
file_base, ext = os.path.splitext(file_name)
if ext in [".rst", ".md"] or file_base.upper() == "README":
return True
else:
return False
================================================
FILE: typot/env.py
================================================
import os
import json
from datetime import datetime, timedelta
import jwt
import requests
def get_private_pem():
key = os.environ.get("PRIVATE_KEY", "")
if not key:
default_path = os.path.join(os.path.dirname(__file__), "../typot.pem")
if os.path.exists(default_path):
with open(default_path, "r", encoding="utf-8") as f:
key = f.readlines()
key = "".join(key)
return key
def get_client_id():
return _get_env("CLIENT_ID")
def get_client_secret():
return _get_env("CLIENT_SECRET")
def make_auth_header(installation_id):
utcnow = datetime.utcnow() + timedelta(seconds=-5)
duration = timedelta(seconds=30)
payload = {
"iat": utcnow,
"exp": utcnow + duration,
"iss": 2510
}
pem = get_private_pem()
encoded = jwt.encode(payload, pem, "RS256")
headers = {
"Authorization": "Bearer " + encoded.decode("utf-8"),
"Accept": "application/vnd.github.machine-man-preview+json"
}
auth_url = "https://api.github.com/installations/{}/access_tokens".format(installation_id)
r = requests.post(auth_url, headers=headers)
if not r.ok:
print(r.json()["message"])
r.raise_for_status()
token = r.json()["token"]
return {
"Authorization": "token {}".format(token)
}
def _get_env(key_name, default_value=""):
env = os.environ.get(key_name, "")
if not env:
env_path = os.path.join(os.path.dirname(__file__), "../envs.json")
if os.path.exists(env_path):
with open(env_path, "r", encoding="utf-8") as f:
envs = json.load(f)
if key_name in envs:
env = envs[key_name]
return env
================================================
FILE: typot/model.py
================================================
class Line():
def __init__(self, line_no, text, relative_no=-1):
self.line_no = line_no
self.text = text
self.relative_no = line_no if relative_no == -1 else relative_no
class DiffContent():
def __init__(self, file_path, contents=()):
self.file_path = file_path
self.contents = contents
def __repr__(self):
return "{}<{}:{} lines>".format(
self.__class__.__name__,
self.file_path,
len(self.contents))
class Modification():
def __init__(self, file_path, line_no, relative_no, target_word, candidates):
self.file_path = file_path
self.line_no = line_no # line no starts from 1
self.relative_no = relative_no # line no starts from 1
self.target_word = target_word
self.candidates = candidates
def __repr__(self):
return "{}<{}, {}@{}>".format(
self.__class__.__name__,
self.file_path, self.target_word, self.line_no)
================================================
FILE: typot/pull_request.py
================================================
from io import StringIO
import re
import base64
import requests
from unidiff import PatchSet
from unidiff.constants import LINE_TYPE_ADDED
from typot.env import make_auth_header
from typot.model import Line, DiffContent, Modification
from typot.spell_checker import SpellChecker
class PullRequest():
API_ROOT = "https://api.github.com"
def __init__(self,
title="",
no=-1,
owner="",
repo="",
head_owner="",
head_repo="",
head_ref="",
diff_url="",
installation_id=""
):
self.title = title
self.no = no
self.owner = owner
self.repo = repo
self.head_owner = head_owner
self.head_repo = head_repo
self.head_ref = head_ref
self.diff_url = diff_url
self.installation_id = installation_id
@classmethod
def create(cls, owner, repo, pull_id):
url = cls.API_ROOT + "/repos/{}/{}/pulls/{}".format(owner, repo, pull_id)
r = requests.get(url)
return cls._create_from_json(r.json())
@classmethod
def create_from_hook(cls, webhook_body):
if "pull_request" not in webhook_body:
return None
pr = webhook_body["pull_request"]
ins = cls._create_from_json(pr)
ins.installation_id = webhook_body["installation"]["id"]
return ins
@classmethod
def _create_from_json(cls, pr):
title = pr["title"]
no = pr["number"]
owner = pr["base"]["repo"]["owner"]["login"]
repo = pr["base"]["repo"]["name"]
head_owner = pr["head"]["repo"]["owner"]["login"]
head_repo = pr["head"]["repo"]["name"]
head_ref = pr["head"]["ref"]
diff_url = pr["diff_url"]
return PullRequest(title, no, owner, repo, head_owner, head_repo, head_ref, diff_url)
def get_added(self):
diff = requests.get(self.diff_url).content.decode("utf-8")
return self._get_added(diff)
@classmethod
def _get_added(cls, diff):
patches = PatchSet(StringIO(diff))
diff_contents = []
for p in patches:
if p.added > 0:
contents = []
for h in p:
added = []
for i, line in enumerate(h):
if line.is_added:
added_line = Line(line.target_line_no, line.value, i + 1)
added.append(added_line)
contents += added
diff_contents.append(
DiffContent(p.path, contents)
)
return diff_contents
def make_review(self, modifications):
url = self.API_ROOT + "/repos/{}/{}/pulls/{}/reviews".format(
self.owner, self.repo, self.no
)
comments = []
for m in modifications:
body = "\"{}\" at {} is typo? \n".format(m.target_word, m.line_no)
body += "\n".join(["- [ ] {}".format(c) for c in m.candidates])
# comment should be done by relative no
c = {
"path": m.file_path,
"position": m.relative_no,
"body": body
}
comments.append(c)
review_id = None
payload = {
"body": "Review from typot",
"event": "COMMENT",
"comments": comments
}
r = requests.post(url, json=payload, headers=make_auth_header(self.installation_id))
if not r.ok:
print(payload)
print(r.json())
r.raise_for_status()
else:
review_id = r.json()["id"]
return review_id
@classmethod
def read_modification(cls, review_comment_hook):
if "comment" not in review_comment_hook:
return None
comment_body = review_comment_hook["comment"]
file_path = comment_body["path"]
relative_no = int(comment_body["position"])
body = comment_body["body"]
r = requests.get(comment_body["url"])
if r.ok:
body = r.json()["body"] # get latest body
target_word = ""
candidates = []
line_no = re.search("at\s\d+\sis", body)
if line_no is not None:
line_no = int(line_no.group(0).split()[1])
else:
line_no =relative_no
words = re.search("\"(\w|-|_)+(\.|\?|\!)?\"", body)
if words is not None:
target_word = words.group(0).replace("\"", "")
mods = re.search("\[x\]\s(\w|-|_)+\n", body)
if mods is not None:
c = mods.group(0)
c = c.strip().replace("[x] ", "")
candidates = [c]
if target_word and len(candidates) > 0:
m = Modification(file_path, line_no, relative_no, target_word, candidates)
return m
else:
return None
def push_modification(self, modification):
url = self.API_ROOT + "/repos/{}/{}/contents/{}".format(
self.head_owner, self.head_repo, modification.file_path
)
r = requests.get(url, params={"ref": self.head_ref})
if not r.ok:
raise Exception("Can not access to the {}/{}'s content.".format(
self.head_owner, self.head_repo
))
encoding = r.encoding
body = r.json()
content = body["content"]
content = base64.b64decode(content).decode(encoding)
sha = body["sha"]
fix_position = int(modification.line_no) - 1 # read file lines start with 0
fixed = content
with StringIO(content) as c:
lines = c.readlines()
words = lines[fix_position].split(" ")
for i, w in enumerate(words):
_w = SpellChecker.strip(w.strip())
if _w == modification.target_word:
words[i] = words[i].replace(_w, modification.candidates[0])
fixed = " ".join(words) + "\n"
lines[fix_position] = fixed
fixed = "".join(lines)
if content != fixed:
encoded = base64.b64encode(fixed.encode(encoding)).decode(encoding)
message = "fix typo: {} to {}, line {}".format(
modification.target_word,
modification.candidates[0],
modification.line_no
)
payload = {
"message": message,
"content": encoded,
"sha": sha,
"branch": self.head_ref
}
r = requests.put(url, json=payload,headers=make_auth_header(self.installation_id))
if not r.ok:
print(r.json())
r.raise_for_status()
return True
return False
================================================
FILE: typot/spell_checker.py
================================================
import enchant
from typot.model import DiffContent, Modification
class SpellChecker():
def __init__(self, lang="en_US"):
self.checker = enchant.Dict(lang)
def check(self, target):
if isinstance(target, DiffContent):
return self.check_diff_content(target)
else:
return self.check_sentence(target)
def check_sentence(self, sentence):
words = self.tokenize(sentence)
miss = {}
if len(words) > 0:
for w in words:
if w and not self.checker.check(w):
miss[w] = self.checker.suggest(w)[:5] # up to five
return miss
def check_diff_content(self, diff_content):
modifications = []
file_path = diff_content.file_path
for c in diff_content.contents:
result = self.check_sentence(c.text)
if len(result) > 0:
for r in result:
m = Modification(file_path, c.line_no, c.relative_no, r, result[r])
modifications.append(m)
return modifications
@classmethod
def strip(cls, word):
_w = word.strip()
return _w.replace("\"", "").replace("'", "").replace(".", "").replace("?", "").replace("!", "")
@classmethod
def tokenize(cls, sentence):
words = sentence.strip().split(" ")
words = [cls.strip(w) for w in words]
words = [w for w in words if w]
return words
gitextract_cd9khm8x/
├── .gitignore
├── Dockerfile
├── LICENSE
├── Procfile
├── README.md
├── get_installations.py
├── requirements.txt
├── tests/
│ ├── dummy_data.py
│ ├── get_installation_id.py
│ ├── test_diff_content.py
│ ├── test_env.py
│ ├── test_pull_request.py
│ └── test_spell_checker.py
└── typot/
├── __init__.py
├── api.py
├── env.py
├── model.py
├── pull_request.py
└── spell_checker.py
SYMBOL INDEX (50 symbols across 11 files)
FILE: get_installations.py
function get_private_pem (line 8) | def get_private_pem(file_path):
FILE: tests/get_installation_id.py
function get (line 5) | def get():
FILE: tests/test_diff_content.py
class TestDiffContent (line 10) | class TestDiffContent(unittest.TestCase):
method test_get_added (line 12) | def test_get_added(self):
method test_line_position (line 19) | def test_line_position(self):
FILE: tests/test_env.py
class TestEnv (line 8) | class TestEnv(unittest.TestCase):
method test_private_key (line 10) | def test_private_key(self):
method test_client_id_secret (line 14) | def test_client_id_secret(self):
FILE: tests/test_pull_request.py
class TestPullRequest (line 15) | class TestPullRequest(unittest.TestCase):
method test_create_instance (line 17) | def test_create_instance(self):
method test_get_added (line 23) | def test_get_added(self):
method test_make_review (line 30) | def test_make_review(self):
method test_read_modification (line 38) | def test_read_modification(self):
method test_push_modification (line 46) | def test_push_modification(self):
FILE: tests/test_spell_checker.py
class TestSpellChecker (line 9) | class TestSpellChecker(unittest.TestCase):
method test_spell_check (line 11) | def test_spell_check(self):
method test_spell_check (line 18) | def test_spell_check(self):
FILE: typot/api.py
function ping (line 14) | def ping():
function typot (line 20) | def typot(body=None):
function is_target_content (line 57) | def is_target_content(file_path):
FILE: typot/env.py
function get_private_pem (line 8) | def get_private_pem():
function get_client_id (line 20) | def get_client_id():
function get_client_secret (line 24) | def get_client_secret():
function make_auth_header (line 27) | def make_auth_header(installation_id):
function _get_env (line 53) | def _get_env(key_name, default_value=""):
FILE: typot/model.py
class Line (line 1) | class Line():
method __init__ (line 3) | def __init__(self, line_no, text, relative_no=-1):
class DiffContent (line 9) | class DiffContent():
method __init__ (line 11) | def __init__(self, file_path, contents=()):
method __repr__ (line 15) | def __repr__(self):
class Modification (line 22) | class Modification():
method __init__ (line 24) | def __init__(self, file_path, line_no, relative_no, target_word, candi...
method __repr__ (line 31) | def __repr__(self):
FILE: typot/pull_request.py
class PullRequest (line 12) | class PullRequest():
method __init__ (line 15) | def __init__(self,
method create (line 38) | def create(cls, owner, repo, pull_id):
method create_from_hook (line 44) | def create_from_hook(cls, webhook_body):
method _create_from_json (line 53) | def _create_from_json(cls, pr):
method get_added (line 65) | def get_added(self):
method _get_added (line 70) | def _get_added(cls, diff):
method make_review (line 90) | def make_review(self, modifications):
method read_modification (line 125) | def read_modification(cls, review_comment_hook):
method push_modification (line 159) | def push_modification(self, modification):
FILE: typot/spell_checker.py
class SpellChecker (line 5) | class SpellChecker():
method __init__ (line 7) | def __init__(self, lang="en_US"):
method check (line 10) | def check(self, target):
method check_sentence (line 16) | def check_sentence(self, sentence):
method check_diff_content (line 26) | def check_diff_content(self, diff_content):
method strip (line 39) | def strip(cls, word):
method tokenize (line 44) | def tokenize(cls, sentence):
Condensed preview — 19 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (150K chars).
[
{
"path": ".gitignore",
"chars": 1220,
"preview": "# Byte-compiled / optimized / DLL files\n__pycache__/\n*.py[cod]\n*$py.class\n\n# C extensions\n*.so\n\n# Distribution / packagi"
},
{
"path": "Dockerfile",
"chars": 292,
"preview": "FROM python:3.4.5\n\nRUN apt-get update\nRUN apt-get install -y enchant\n\nADD ./requirements.txt /tmp/requirements.txt\nRUN p"
},
{
"path": "LICENSE",
"chars": 11336,
"preview": " Apache License\n Version 2.0, January 2004\n "
},
{
"path": "Procfile",
"chars": 24,
"preview": "web: hug -f typot/api.py"
},
{
"path": "README.md",
"chars": 769,
"preview": "# typot\n\n**typot** detects the typos in your pull request, and fix it by just selecting the modification candidates.\n\n!["
},
{
"path": "get_installations.py",
"chars": 1644,
"preview": "import os\nimport argparse\nfrom datetime import datetime, timedelta\nimport requests\nimport jwt\n\n\ndef get_private_pem(file"
},
{
"path": "requirements.txt",
"chars": 93,
"preview": "hug==2.3.0\nrequests==2.14.2\nunidiff==0.5.3\npyenchant==1.6.8\nPyJWT==1.5.0\ncryptography==1.8.2\n"
},
{
"path": "tests/dummy_data.py",
"chars": 106484,
"preview": "pull_request_created = \"\"\"\n{\n \"action\": \"opened\",\n \"number\": 2,\n \"pull_request\": {\n \"url\": \"https://api.github.com"
},
{
"path": "tests/get_installation_id.py",
"chars": 510,
"preview": "import os\nimport json\n\n\ndef get():\n path = os.path.join(os.path.dirname(__file__), \"./test_installation_id.json\")\n "
},
{
"path": "tests/test_diff_content.py",
"chars": 885,
"preview": "import os\nimport sys\nsys.path.append(os.path.join(os.path.dirname(__file__), \"../\"))\nimport unittest\nfrom typot.pull_req"
},
{
"path": "tests/test_env.py",
"chars": 508,
"preview": "import os\nimport sys\nsys.path.append(os.path.join(os.path.dirname(__file__), \"../\"))\nimport unittest\nimport typot.env as"
},
{
"path": "tests/test_pull_request.py",
"chars": 1840,
"preview": "import os\nimport sys\nsys.path.append(os.path.join(os.path.dirname(__file__), \"../\"))\nimport json\nimport unittest\nfrom ty"
},
{
"path": "tests/test_spell_checker.py",
"chars": 834,
"preview": "import os\nimport sys\nsys.path.append(os.path.join(os.path.dirname(__file__), \"../\"))\nimport unittest\nfrom typot.model im"
},
{
"path": "typot/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "typot/api.py",
"chars": 1917,
"preview": "import os\nimport sys\nsys.path.append(os.path.join(os.path.dirname(__file__), \"../\"))\nimport hug\nfrom typot.pull_request "
},
{
"path": "typot/env.py",
"chars": 1760,
"preview": "import os\nimport json\nfrom datetime import datetime, timedelta\nimport jwt\nimport requests\n\n\ndef get_private_pem():\n k"
},
{
"path": "typot/model.py",
"chars": 1001,
"preview": "class Line():\n\n def __init__(self, line_no, text, relative_no=-1):\n self.line_no = line_no\n self.text ="
},
{
"path": "typot/pull_request.py",
"chars": 6862,
"preview": "from io import StringIO\nimport re\nimport base64\nimport requests\nfrom unidiff import PatchSet\nfrom unidiff.constants impo"
},
{
"path": "typot/spell_checker.py",
"chars": 1486,
"preview": "import enchant\nfrom typot.model import DiffContent, Modification\n\n\nclass SpellChecker():\n\n def __init__(self, lang=\"e"
}
]
About this extraction
This page contains the full source code of the chakki-works/typot GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 19 files (136.2 KB), approximately 37.7k tokens, and a symbol index with 50 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.