Skip to content

Commit 858799b

Browse files
sbs-catsthdaraujo
andauthored
Update contribution guidelines and PULL_REQUEST_TEMPLATE (#2878)
* Update contribution guidelines and PULL_REQUEST_TEMPLATE Based on this discussion, we need to update the docs for contributing to faker-ruby. https://github.com/orgs/faker-ruby/discussions/2877 * Better wording * Update CONTRIBUTING.md Co-authored-by: Thiago Araujo <[email protected]> * Update PULL_REQUEST_TEMPLATE.md * Update CONTRIBUTING.md --------- Co-authored-by: Thiago Araujo <[email protected]>
1 parent 3e7fa64 commit 858799b

File tree

3 files changed

+30
-18
lines changed

3 files changed

+30
-18
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ Feel free to discard it if you need to (e.g. when you just fix a typo). -->
2121
### Motivation / Background
2222

2323
<!--
24-
Describe why this Pull Request needs to be merged. What bug have you fixed? What feature have you added? Why is it important?
24+
Describe why this Pull Request needs to be merged. What bug have you fixed? Why is it important?
2525
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.
2626
27-
If you're proposing a new generator, please follow the [Documentation guidelines](https://github.com/faker-ruby/faker/blob/main/CONTRIBUTING.md#documentation).
27+
If you're proposing a new generator or locale, please review and follow the [Contributing guidelines](https://github.com/faker-ruby/faker/blob/main/CONTRIBUTING.md) first.
2828
-->
2929

30-
This Pull Request has been created because [REPLACE ME]
30+
This Pull Request has been created because [REPLACE ME].
3131

3232
### Additional information
3333

@@ -42,8 +42,7 @@ Before submitting the PR make sure the following are checked:
4242
* [ ] Tests are added or updated if you fix a bug, refactor something, or add a feature.
4343
* [ ] Tests and Rubocop are passing before submitting your proposed changes.
4444

45-
If you're proposing a new generator:
45+
If you're proposing a new generator or locale:
4646

47-
* [ ] Open an issue first for discussion before you write any code.
4847
* [ ] 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).
48+
* [ ] You've reviewed and followed the [Contributing guidelines](https://github.com/faker-ruby/faker/blob/main/CONTRIBUTING.md).

CONTRIBUTING.md

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,33 @@ We are always happy to make improvements to Faker. There are many ways to contri
44

55
Following these guidelines helps to communicate that you respect the time of the developers managing and developing this open source project. In return, they should reciprocate that respect by addressing your issue, assessing changes, and helping you finalize your pull requests.
66

7-
Have a fix for a problem you've been running into or an idea for a new feature you think would be useful? Here's what you need to do:
7+
## Reporting a bug
8+
9+
Have a fix for a problem you've been running into? Here's what you need to do:
810

911
- Fork this repo and clone your fork to somewhere on your machine.
1012
- [Ensure that you have a working environment](#setting-up-your-environment).
1113
- Read up on the [architecture of the gem](#architecture), [how to run tests](#running-the-tests), and [the code style we use in this project](#code-style).
1214
- Cut a new branch and write a failing test for the feature or bugfix you plan on implementing.
1315
- [Make sure your branch is well managed as you go along](#managing-your-branch).
14-
- Review the guidelines for [adding new generators](#adding-new-generators), [adding YAML files](#yaml-files), and [YARD docs](#yard-docs).
1516
- [Refrain from updating the changelog](#a-word-on-the-changelog).
1617
- Push to your fork and submit a pull request.
1718
- [Ensure that the test suite passes on GitHub Actions and make any necessary changes to your branch to bring it to green](#continuous-integration).
1819

20+
## What contributions we are looking for
21+
22+
faker-ruby already has lots of generators and locales. We appreciate any efforts made into updating the **existing** locales by:
23+
24+
- adding new translations
25+
- updating the existing translations
26+
- fixing any outdated/wrong translations
27+
1928
Although we maintain Faker in our free time, we try to respond to contributions in a timely manner. Once we look at your pull request, we may give you feedback. For instance, we may suggest some changes to make to your code to fit within the project style or discuss alternate ways of addressing the issue in question. Assuming we're happy with everything, we'll then bring your changes into main. Now you're a contributor!
2029

2130
## Setting up your environment
2231

2332
Faker requires Ruby version >= 2.7. After forking, and cloning the repo, navigate to the directory, and run:
2433

25-
2634
```ruby
2735
bundle install
2836
```
@@ -32,17 +40,14 @@ Run `rake` to ensure the project is all setup. It runs the tests and rubocop. Th
3240
## Architecture
3341

3442
This project follows the typical structure for a gem: code is located in `/lib` and tests are in `/test`. Generators
35-
3643
docs are available in the `/doc` folder.
3744

38-
3945
## Running the tests
4046

4147
To run all of the tests, simply run:
4248

4349
```ruby
4450
bundle exec rake test
45-
4651
```
4752

4853
## Code Style
@@ -64,21 +69,31 @@ There are a few ways to run RuboCop:
6469

6570
```ruby
6671
`bundle exec rubocop` #-> to run Rubocop only
67-
6872
`bundle exec rake` #-> to run the test suite and rubocop after.
6973
```
7074

7175
## Managing your branch
7276

7377
- Use well-crafted commit messages and Pull Requests descriptions, providing context if possible. Please use the Pull Request template when opening a new PR.
74-
- When updating documentation, or README, [skip running worfklow runs](https://docs.github.com/en/actions/managing-workflow-runs/skipping-workflow-runs).
78+
- When updating documentation, or README, [skip running CI](https://docs.github.com/en/actions/managing-workflow-runs/skipping-workflow-runs).
7579
- Squash "WIP" commits and remove merge commits by rebasing your branch against main. We try to keep our commit history as clean as possible.
7680
- To prevent pushing with test failures or Rubocop offenses, see [Setup a custom pre-push git hook](#setup-a-custom-pre-push-git-hook).
7781

78-
## Adding new generators
82+
## Adding new generators/locales
83+
84+
New generators will only be added to the gem after:
85+
86+
- there's been a poll in the [community](https://github.com/orgs/faker-ruby/discussions/categories/new-feature-locale-generator). Use this to get feedback on how others would use it, what edge cases to cover, etc.
87+
- the community is interested in the feature.
88+
89+
This allow us to measure the interest and see some traction before we decide to accept the proposal for a new generator.
90+
91+
**Note**: we will not accept new generators/locales that do not follow the requirements above.
7992

8093
### General Guidelines
8194

95+
Once the feature has met the requirements above, please review these guidelines before opening a PR:
96+
8297
- Avoid:
8398
- Hurtful language that can convey exclusionary behavior, such as racism, sexism, homophobia.
8499
- Graphically violent or harmful terms towards any living beings.

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -479,10 +479,8 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'main
479479

480480
## Contributing
481481

482-
If you have problems, please create a [GitHub Issue](/.github/ISSUE_TEMPLATE/bug-report.md).
483-
484482
Take a look at the [Contributing](CONTRIBUTING.md) document for
485-
instructions on setting up the repo on your machine, understanding the codebase,
483+
instructions on setting up the repo on your machine, opening bug reports, understanding the codebase,
486484
and creating a good pull request.
487485

488486
There is a [Discord channel](https://discord.gg/RMumTwB) to discuss anything

0 commit comments

Comments
 (0)