Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update contribution guidelines and PULL_REQUEST_TEMPLATE #2878

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ Feel free to discard it if you need to (e.g. when you just fix a typo). -->
### Motivation / Background

<!--
Describe why this Pull Request needs to be merged. What bug have you fixed? What feature have you added? Why is it important?
Describe why this Pull Request needs to be merged. What bug have you fixed? Why is it important?
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.

If you're proposing a new generator, please follow the [Documentation guidelines](https://github.com/faker-ruby/faker/blob/main/CONTRIBUTING.md#documentation).
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.
-->

This Pull Request has been created because [REPLACE ME]
This Pull Request has been created because [REPLACE ME].

### Additional information

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

If you're proposing a new generator:
If you're proposing a new generator or locale:

* [ ] Open an issue first for discussion before you write any code.
* [ ] Double-check the existing generators documentation to make sure the new generator you want to add doesn't already exist.
* [ ] You've reviewed and followed the [Documentation guidelines](https://github.com/faker-ruby/faker/blob/main/CONTRIBUTING.md#documentation).
* [ ] You've reviewed and followed the [Contributing guidelines](https://github.com/faker-ruby/faker/blob/main/CONTRIBUTING.md).
33 changes: 24 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,33 @@ We are always happy to make improvements to Faker. There are many ways to contri

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.

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:
## Reporting a bug

Have a fix for a problem you've been running into? Here's what you need to do:

- Fork this repo and clone your fork to somewhere on your machine.
- [Ensure that you have a working environment](#setting-up-your-environment).
- 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).
- Cut a new branch and write a failing test for the feature or bugfix you plan on implementing.
- [Make sure your branch is well managed as you go along](#managing-your-branch).
- Review the guidelines for [adding new generators](#adding-new-generators), [adding YAML files](#yaml-files), and [YARD docs](#yard-docs).
stefannibrasil marked this conversation as resolved.
Show resolved Hide resolved
- [Refrain from updating the changelog](#a-word-on-the-changelog).
- Push to your fork and submit a pull request.
- [Ensure that the test suite passes on GitHub Actions and make any necessary changes to your branch to bring it to green](#continuous-integration).

## What contributions we are looking for

faker-ruby already has lots of generators and locales. We appreciate any efforts made into updating the **existing** locales by:

- adding new translations
- updating the existing translations
- fixing any outdated/wrong translations

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!

## Setting up your environment

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


```ruby
bundle install
```
Expand All @@ -32,17 +40,14 @@ Run `rake` to ensure the project is all setup. It runs the tests and rubocop. Th
## Architecture

This project follows the typical structure for a gem: code is located in `/lib` and tests are in `/test`. Generators

docs are available in the `/doc` folder.


## Running the tests

To run all of the tests, simply run:

```ruby
bundle exec rake test

```

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

```ruby
`bundle exec rubocop` #-> to run Rubocop only

`bundle exec rake` #-> to run the test suite and rubocop after.
```

## Managing your branch

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

## Adding new generators
## Adding new generators/locales

New generators will only be added to the gem after:

- 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.
- the community is interested in the feature.

This allow us to measure the interest and see some traction before we decide to accept the proposal for a new generator.

**Note**: we will not accept new generators/locales that do not follow the requirements above.

### General Guidelines

Once the feature has met the requirements above, please review these guidelines before opening a PR:

- Avoid:
- Hurtful language that can convey exclusionary behavior, such as racism, sexism, homophobia.
- Graphically violent or harmful terms towards any living beings.
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -479,10 +479,8 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'main

## Contributing

If you have problems, please create a [GitHub Issue](/.github/ISSUE_TEMPLATE/bug-report.md).

Take a look at the [Contributing](CONTRIBUTING.md) document for
instructions on setting up the repo on your machine, understanding the codebase,
instructions on setting up the repo on your machine, opening bug reports, understanding the codebase,
and creating a good pull request.

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