ruby Hack在拉取请求期间自动化样式指南评论

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ruby Hack在拉取请求期间自动化样式指南评论相关的知识,希望对你有一定的参考价值。

# Prerequisites:
#
# * Add pronto, pronto-rubocop, and any other pronto runners to Gemfile's
#   development group (TODO: how to run using standalone gems?)
#   Add dotenv to project's Gemfile, if necessary (dotenv-rails includes
#   it by default)
# * Create a GitHub API token: https://github.com/settings/tokens.
#   Give it the following scopes: repo, repo:status
#   See this tutorial for more info:
#   https://christoph.luppri.ch/articles/2017/03/05/how-to-automatically-review-your-prs-for-style-violations-with-pronto-and-rubocop/

class PR < Thor
  include Thor::Actions

  # Usage:
  # Note pull request ID in the GitHub UI or URL
  # cd path/to/app
  # git checkout <branch-to-review>
  # thor pr:review
  desc "review", "automated code review for style guide issues"
  def review
    if (token = ENV["PRONTO_GITHUB_ACCESS_TOKEN"])
      puts "PRONTO_GITHUB_ACCESS_TOKEN found in ENV"
    else
      token = ask "GitHub access token:"
    end

    id = ask "Pull request ID:"
    base = ask "Base for comparison:", default: "origin/master"
    run "PRONTO_GITHUB_ACCESS_TOKEN=#{token} PULL_REQUEST_ID=#{id} pronto run -f github_status github_pr -c #{base}"
  end
end

以上是关于ruby Hack在拉取请求期间自动化样式指南评论的主要内容,如果未能解决你的问题,请参考以下文章

在拉取期间解决 Git 合并冲突以支持其更改

如何在拉取请求中压缩提交

在拉取请求时重命名分支

在拉取请求完成时隐藏 Github 操作

GitHub:获取当前在拉取请求中的一个特定文件的所有更改

Git-TFS - 如何在拉取请求被批准之前确保分支是最新的?