github api 以及如何获取代码片段和评论以进行拉取
github api and how to get code snippets and comments for a pull
我正在尝试使用 github api 生成报告,我可以在其中查看拉取请求中更新的代码以及与之相关的评论。我查看了事件时间线、评论端点和拉取请求 diff_url,但似乎无法像这样 jquery event/conversion 项目随机获取信息拉取请求:
我什至不需要漂亮的 add/delete 底纹,文字很好。我可以从拉取请求中获取 diff_url,它确实向我显示了按顺序列出的所有文件中的所有代码更改,但无法使用评论 "There should probably be a line break here." 及其代码获取此特定视图参考。
非常感谢任何见解!
我联系了 github 支持,再次得到了他们的大力支持!
(谢谢你!)。 'This is how you do it' <- 合唱...
是的,您可以通过 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\"",
结合实际从函数返回值并根据需要格式化模板,就可以完成工作。
我正在尝试使用 github api 生成报告,我可以在其中查看拉取请求中更新的代码以及与之相关的评论。我查看了事件时间线、评论端点和拉取请求 diff_url,但似乎无法像这样 jquery event/conversion 项目随机获取信息拉取请求:
我什至不需要漂亮的 add/delete 底纹,文字很好。我可以从拉取请求中获取 diff_url,它确实向我显示了按顺序列出的所有文件中的所有代码更改,但无法使用评论 "There should probably be a line break here." 及其代码获取此特定视图参考。
非常感谢任何见解!
我联系了 github 支持,再次得到了他们的大力支持!
(谢谢你!)。 'This is how you do it' <- 合唱...
是的,您可以通过 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\"",
结合实际从函数返回值并根据需要格式化模板,就可以完成工作。