0.0
No release in over a year
Provide formatted diffs as suggestions in GitHub Pull Requests.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

diff-suggester

It collaborates with formatters to suggest the differences shown by 'git diff' for GitHub Pull Request.

How to use

  1. Install
gem install diff-suggester
  1. Usage

First, run the formatter. Example for Android using spotless and ktlint is:

./gradlew spotlessKotlinApply

Next, run the suggester. It will comment the suggested changes as a diff on the Pull Request.

suggester = DiffSuggester::Suggester.new(
  repo: '<your-name/repo-name>',
  pr_number: 0, # Pull Request number
  access_token: '<Your PAT>'
)
suggester.suggest

If use GitHub Actions:

    - name: Run suggester
      env:
        REPOSITORY: ${{ github.repository }}
        PR_NUMBER: ${{ github.event.number }}
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      run: ruby suggest.rb
suggester = DiffSuggester::Suggester.new(
	repo: ENV["REPOSITORY"],
	pr_number: ENV["PR_NUMBER"],
	access_token: ENV["GITHUB_TOKEN"]
)
suggester.suggest