You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* 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
<!-- If there's anything else that's important and relevant to your pull request, mention that information here.
14
+
About this template
10
15
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.
12
18
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). -->
14
20
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).
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+20-14Lines changed: 20 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -71,29 +71,25 @@ There are a few ways to run RuboCop:
71
71
72
72
## Managing your branch
73
73
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.
76
75
- Squash "WIP" commits and remove merge commits by rebasing your branch against main. We try to keep our commit history as clean as possible.
77
76
- To prevent pushing with test failures or Rubocop offenses, see [Setup a custom pre-push git hook](#setup-a-custom-pre-push-git-hook).
78
77
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
-
89
78
## Adding new generators
90
79
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.
91
83
- 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.
92
84
- 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.
94
87
95
-
### YARD docs
88
+
### Documentation
96
89
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
97
93
- Include [YARD] style docs for all methods that includes:
98
94
- A short description of what the method generates
99
95
- 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
173
169
* Use the `rake console` task to start a session with Faker loaded.
174
170
* Use `bundle exec yard server -r` to launch the YARD Doc server.
175
171
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
+
176
182
## Setup a custom pre-push git hook
177
183
178
184
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