Skip to content

Instantly share code, notes, and snippets.

@coderberry
Created January 30, 2024 15:51
Show Gist options
  • Save coderberry/7457cee155f79402bfe4b689d6721daa to your computer and use it in GitHub Desktop.
Save coderberry/7457cee155f79402bfe4b689d6721daa to your computer and use it in GitHub Desktop.
Run `bundle exec standardrb` on all files changed within the current pull request
#!/usr/bin/env ruby
file_list = `gh pr diff $(git rev-parse --abbrev-ref HEAD) --name-only`
pr_files = file_list.split("\n")
puts "Running standardrb --fix on:"
pr_files.each { |f| puts " - #{f}" }
puts # empty line
system("bundle exec standardrb --fix #{pr_files.join(' ')}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment