Skip to content

Commit 949661c

Browse files
author
Stefanni Brasil
authored
Update Pull Request template and guides (#2749)
* Update Pull Request template and guides It's easy to forget more details, review the docs when opening a PR. To help everyone, I'm updating the PR template and its reference to the documentation guidelines. * Add suggestions from code review * Add note about innapropriate language when adding new generators
1 parent 8bbdedf commit 949661c

File tree

2 files changed

+62
-22
lines changed

2 files changed

+62
-22
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 42 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,49 @@
1-
### Summary
1+
<!--
2+
Thanks for contributing to faker-ruby!
23
3-
<!-- Provide a general description of the code changes in your pull request.
4+
Please do not make *Draft* pull requests, as they still send
5+
notifications to everyone watching the faker-ruby repo.
46
5-
Were there any bugs you had fixed? If so, mention them: Fixes Issue #add-issue-number -->
7+
Create a pull request when it is ready for review and feedback
8+
from the faker-ruby team :).
69
7-
### Other Information
10+
If your pull request affects documentation or any non-code
11+
changes, guidelines for those changes are [available
12+
here](https://github.com/faker-ruby/faker/blob/main/CONTRIBUTING.md#documentation).
813
9-
<!-- If there's anything else that's important and relevant to your pull request, mention that information here.
14+
About this template
1015
11-
If you are creating a new generator, share how you are going to use it. Use cases are important to make sure that our faker generators are useful. Also, add `@faker.version next` to help users know when a generator was added. See [this example](https://github.com/faker-ruby/faker/blob/aa31845ed54c25eb2638d716bfddf59771b502aa/lib/faker/music/opera.rb#L68).
16+
The following template aims to help contributors write a good description for their pull requests.
17+
We'd like you to provide a description of the changes in your pull request (i.e. bugs fixed or features added), motivation behind the changes, and complete the checklist below before opening a pull request.
1218
13-
Finally, if your pull request affects documentation, please follow the [Guidelines](https://github.com/faker-ruby/faker/blob/main/CONTRIBUTING.md#documentation).
19+
Feel free to discard it if you need to (e.g. when you just fix a typo). -->
1420

15-
Thanks for contributing to Faker! -->
21+
### Motivation / Background
22+
23+
<!--
24+
Describe why this Pull Request needs to be merged. What bug have you fixed? What feature have you added? Why is it important?
25+
If you are fixing a specific issue, include "Fixes #ISSUE" (replace with the issue number, remove the quotes) and the issue will be linked to this PR.
26+
27+
If you're proposing a new generator, please follow the [Documentation guidelines](https://github.com/faker-ruby/faker/blob/main/CONTRIBUTING.md#documentation).
28+
-->
29+
30+
This Pull Request has been created because [REPLACE ME]
31+
32+
### Additional information
33+
34+
<!-- Provide additional information such as benchmarks, reference to other repositories or alternative solutions. -->
35+
36+
### Checklist
37+
38+
Before submitting the PR make sure the following are checked:
39+
40+
* [ ] This Pull Request is related to one change. Changes that are unrelated should be opened in separate PRs.
41+
* [ ] Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: `[Fix #issue-number]`
42+
* [ ] Tests are added or updated if you fix a bug, refactor something, or add a feature.
43+
* [ ] Tests and Rubocop are passing before submitting your proposed changes.
44+
45+
If you're proposing a new generator:
46+
47+
* [ ] Open an issue first for discussion before you write any code.
48+
* [ ] Double-check the existing generators documentation to make sure the new generator you want to add doesn't already exist.
49+
* [ ] You've reviewed and followed the [Documentation guidelines](https://github.com/faker-ruby/faker/blob/main/CONTRIBUTING.md#documentation).

CONTRIBUTING.md

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -71,29 +71,25 @@ There are a few ways to run RuboCop:
7171

7272
## Managing your branch
7373

74-
- Use well-crafted commit messages and Pull Requests descriptions, providing context if possible.
75-
74+
- Use well-crafted commit messages and Pull Requests descriptions, providing context if possible. Please use the Pull Request template when opening a new PR.
7675
- Squash "WIP" commits and remove merge commits by rebasing your branch against main. We try to keep our commit history as clean as possible.
7776
- To prevent pushing with test failures or Rubocop offenses, see [Setup a custom pre-push git hook](#setup-a-custom-pre-push-git-hook).
7877

79-
## A word on the changelog
80-
81-
You may also notice that we have a changelog in the form of CHANGELOG.md. You may be tempted to include changes to this in your branch, but don't worry about this — we'll take care of it!
82-
83-
## Continuous integration
84-
85-
GitHub Actions will kick in after you push up a branch or open a PR. It takes a few minutes to run a complete build, which you are free to monitor as it progresses. First-time contributors may need to wait until a maintainer approves the build.
86-
87-
What happens if the build fails in some way? Don't fear! Click on a failed job and scroll through its output to determine the cause of the failure. You'll want to make changes to your branch and push them up until the entire build is green. It may take a bit of time, but overall it is worth it and it helps us immensely!
88-
8978
## Adding new generators
9079

80+
### General Guidelines
81+
82+
- Don't include hurtful language that can convey exclusionary behavior, such as racism, sexism, homophobia. Be considerate and mindful of others.
9183
- Don't use `Array#sample`, `Array#shuffle` and `Kernel#rand` on your new generator if you want to randomly pick values. Instead, you should use the methods provided by the Base class: `sample`, `shuffle` and `rand`. The reason is that we want to preserve the deterministic feature of this gem.
9284
- Please make sure the generator doesn't exist already before opening a PR.
93-
- Add a new YAML file to `lib/locales/en` rather than adding translations to `lib/locales/en.yml`. For example, if you add `Faker::MyThing`, put your translations in `lib/locales/en/my_thing.yml`. See [the locale README](./lib/locales/en/README.md) for more info.
85+
- Add a new YAML file to `lib/locales/en` rather than adding translations to the `lib/locales/en.yml` file. For example, if you add `Faker::MyThing`, put your translations in `lib/locales/en/my_thing.yml`.
86+
- When possible, consider adding the new YAML file inside a folder to keep things organized, for example: `lib/locales/en/quotes/parks_and_rec.yml`. See [the locale README](./lib/locales/en/README.md) for more info.
9487

95-
### YARD docs
88+
### Documentation
9689

90+
Add the new generator to the [Generators list in the README](./README.md#generators) so other people can find them.
91+
92+
#### YARD docs
9793
- Include [YARD] style docs for all methods that includes:
9894
- A short description of what the method generates
9995
- Descriptions for all params (`@param`)
@@ -173,6 +169,16 @@ When in doubt, run `bundle exec rake reformat_yaml['lib/path/to/file.yml']` to r
173169
* Use the `rake console` task to start a session with Faker loaded.
174170
* Use `bundle exec yard server -r` to launch the YARD Doc server.
175171

172+
## A word on the changelog
173+
174+
You may also notice that we have a changelog in the form of CHANGELOG.md. You may be tempted to include changes to this in your branch, but don't worry about this — we'll take care of it!
175+
176+
## Continuous integration
177+
178+
GitHub Actions will kick in after you push up a branch or open a PR. It takes a few minutes to run a complete build, which you are free to monitor as it progresses. First-time contributors may need to wait until a maintainer approves the build.
179+
180+
What happens if the build fails in some way? Don't fear! Click on a failed job and scroll through its output to determine the cause of the failure. You'll want to make changes to your branch and push them up until the entire build is green. It may take a bit of time, but overall it is worth it and it helps us immensely!
181+
176182
## Setup a custom pre-push git hook
177183

178184
There is a custom git hooks pre-push file. Before the push occurs, it runs the tests and Rubocop. If there are any tests failures, or Rubocop offenses, the push is aborted.

0 commit comments

Comments
 (0)