我聯繫了github支持,並再次得到了他們的支持!
(謝謝!)。 '這是你怎麼做'< - 唱調...
是的,你可以通過API獲取代碼段和評論。什麼你要找的是在這裏:
https://developer.github.com/v3/pulls/comments/#list-comments-on-a-pull-request
如果你取的是,「body
」現場會給你意見的內容和「diff_hunk
」現場會給你片斷的評論是(「path
」字段告訴你代碼片段來自哪個文件)。
例子:注意此評論:
https://github.com/github/linguist/pull/3820/files#r143359135
這裏的API在註釋:相關領域
https://api.github.com/repos/github/linguist/pulls/comments/143359135
和:
"body": "https://github.com/github/linguist/pull/3638
attempted to include support for the `.k` extension too,
which would have posed a problem due to clashing with non-Kdb,
yet undefined, languages.
This PR doesn't mention that extension at all.
Whilst this isn't a problem, is `.q` the preferred extension for
Q/Kdb+?\r\n\r\nI
notice that https://github.com/KxSystems/kdb which you reference
includes `.k` files which won't be recognised as Q/Kdb+ once
this PR has been merged, hence the question.",
"path": "lib/linguist/languages.yml",
"diff_hunk": "@@ -3601,6 +3601,18 @@ Python traceback:\n
tm_scope: text.python.traceback\n
ace_mode: text\n
language_id: 304\n+Q:\n+
type: programming\n+
color: \"#0040CD\"\n+
aliases:\n+ -Kdb+\n+
extensions:\n+ - \".q\"",
這一點,再加與實際回報根據需要從函數中獲取值並格式化模板將完成工作。
我已經嘗試了一個似乎可以工作的捲曲,但是無法從我的python中得到它的工作,即使(我認爲是)正確的Accept頭部。我使用的捲曲模式是: curl -u「username:password」-H「Accept:application/vnd.github.v3 + .html + json」https://api.github.com/repos/repo-所有者/回購 - 名稱/拉/拉 - #/評論 我得到的輸出,顯示一個diff_hunk與評論和審查 - 完美。但不會與使用python的代碼一起飛行: requests.get(get_url,auth =(self.username,self.password),headers = headers) – campana