github 지원팀에 연락하여 다시 한 번 훌륭한 지원을 얻었습니다!
(감사합니다!) '이것은 당신이하는 방법입니다'< - 조정 된 노래 ...
그래, 코드 스 니펫과 주석을 API를 통해 얻을 수 있습니다. 당신이 찾고있는 것은 여기에 있습니다 :
https://developer.github.com/v3/pulls/comments/#list-comments-on-a-pull-request
는 "body
"필드는 당신에게 코멘트의 내용과 "diff_hunk
"필드는 당신에게 의견이 스 니펫을 줄 것를 제공합니다 것을 가져 오는 경우 관련 ("path
"필드는 스 니펫이있는 파일을 알려줍니다).
예 :
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\"",
이를 결합
여기 https://github.com/github/linguist/pull/3820/files#r143359135
가 그 API의 코멘트입니다 :이 댓글을 통지 실제로 돌아온다. 함수에서 값을 가져오고 필요에 따라 템플릿을 포맷하면 작업이 완료됩니다.
나는 제대로 작동하는 것처럼 보이지만, 파이썬에서 작동하도록 얻을 수는 없다. (필자의 생각에는) 올바른 Accept 헤더가있다. 내가 사용하고있는 컬 패턴은 다음과 같습니다. curl -u "username : password"-H "accept : application/vnd.github.v3 + .html + json"https://api.github.com/repos/repo- owner/repo-name/pulls/pull - #/comments diff_hunk와 댓글 및 리뷰어가 함께 출력됩니다. 하지만 파이썬을 사용하여 코드를 비행하지 않습니다 : requests.get (get_url, auth = (self.username, self.password), headers = headers) – campana