Skip to content

Commit

Permalink
Add the option to create a simple GitHub PR template (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattbrictson authored Oct 30, 2023
1 parent 7378602 commit 62d2a13
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 0 deletions.
4 changes: 4 additions & 0 deletions config/generators.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ factory_bot_rails:
description: "Install and configure factory_bot_rails gem"
requires: active_record

github_pr_template:
prompt: "GitHub PR template"
description: "Add GitHub pull request template"

git_safe:

good_migrations:
Expand Down
1 change: 1 addition & 0 deletions lib/nextgen/generators/github_pr_template.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
template ".github/PULL_REQUEST_TEMPLATE.md.tt"
21 changes: 21 additions & 0 deletions template/.github/PULL_REQUEST_TEMPLATE.md.tt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Problem
=======

<!-- describe what motivated this PR -->

<!-- link to issue or ticket -->

Solution
========

Steps to verify
---------------

1. step
1. step
1. step
<% if File.exist?("app/views/layouts/application.html.erb") -%>

Screenshots
-----------
<% end -%>
11 changes: 11 additions & 0 deletions test/nextgen/generators/github_pr_template_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
require_relative "test_case"

class Nextgen::Generators::GithubPrTemplateTest < Nextgen::Generators::TestCase
destination File.join(Dir.tmpdir, "test_#{SecureRandom.hex(8)}")
setup :prepare_destination

test "creates a .github/PULL_REQUEST_TEMPLATE.md file" do
apply_generator
assert_file ".github/PULL_REQUEST_TEMPLATE.md"
end
end

0 comments on commit 62d2a13

Please sign in to comment.