Skip to content

Commit 2a03da0

Browse files
authored
Update contributing and maintaining guides (#2836)
* Update CONTRIBUTING doc * Update MAINTAINING doc [ci skip] * Add PositionalGenerator helper to docs [ci skip]
1 parent c6608ee commit 2a03da0

File tree

2 files changed

+23
-9
lines changed

2 files changed

+23
-9
lines changed

CONTRIBUTING.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ 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-
87
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:
98

109
- Fork this repo and clone your fork to somewhere on your machine.
@@ -64,24 +63,32 @@ Please follow these guidelines when adding new code:
6463
There are a few ways to run RuboCop:
6564

6665
```ruby
67-
`bundle exec rubocop` #-> to only run Rubocop
66+
`bundle exec rubocop` #-> to run Rubocop only
6867

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

7271
## Managing your branch
7372

7473
- 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).
7575
- Squash "WIP" commits and remove merge commits by rebasing your branch against main. We try to keep our commit history as clean as possible.
7676
- To prevent pushing with test failures or Rubocop offenses, see [Setup a custom pre-push git hook](#setup-a-custom-pre-push-git-hook).
7777

7878
## Adding new generators
7979

8080
### General Guidelines
8181

82-
- Don't include hurtful language that can convey exclusionary behavior, such as racism, sexism, homophobia. Be considerate and mindful of others.
82+
- Avoid:
83+
- Hurtful language that can convey exclusionary behavior, such as racism, sexism, homophobia.
84+
- Graphically violent or harmful terms towards any living beings.
85+
- When possible, avoid the use of figurative language that can be interpreted as violent, such as hang, and hit.
86+
- Unnecessarily gendered language.
87+
- Be considerate and mindful of others as much as possible.
88+
- When adding new generators, limit the number of values per generator in the YML file. Adding a long YML file makes it harder to review your PR.
8389
- 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.
84-
- Please make sure the generator doesn't exist already before opening a PR.
90+
- Make sure the generator doesn't exist already before opening a PR.
91+
- Use the [PositionalGenerator](https://github.com/faker-ruby/faker/blob/main/lib/helpers/positional_generator.rb) helper when generating a list of generated values that fit a specific format, such as an ID, postal code, or phone number.
8592
- 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`.
8693
- 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.
8794

@@ -90,7 +97,8 @@ There are a few ways to run RuboCop:
9097
Add the new generator to the [Generators list in the README](./README.md#generators) so other people can find them.
9198

9299
#### YARD docs
93-
- Include [YARD] style docs for all methods that includes:
100+
101+
Include [YARD] style docs for all methods that includes:
94102
- A short description of what the method generates
95103
- Descriptions for all params (`@param`)
96104
- The return type (`@return`)
@@ -169,7 +177,7 @@ When in doubt, run `bundle exec rake reformat_yaml['lib/path/to/file.yml']` to r
169177
* Use the `rake console` task to start a session with Faker loaded.
170178
* Use `bundle exec yard server -r` to launch the YARD Doc server.
171179

172-
## A word on the changelog
180+
## A word on the Changelog
173181

174182
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!
175183

MAINTAINING.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### Maintaining Faker
1+
## Maintaining faker-ruby
22

33
As maintainers of the gem, this is our guide. Most of the steps and guidelines in the Contributing document apply here, including how to set up your environment, write code to fit the code style, run tests, craft commits and manage branches. Beyond this, this document provides some details that would be too low-level for contributors.
44

@@ -10,12 +10,18 @@ If you're reviewing a PR, you should ask yourself:
1010
> * Is it well documented?
1111
> * Is it following the structure of the project?
1212
13-
# TODO
13+
## Security
14+
15+
- Please review [GitHub's Good security practices for using GitHub Actions features](https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions) often.
16+
- Only [approve first time contributors PRs](https://github.blog/2021-04-22-github-actions-update-helping-maintainers-combat-bad-actors/) after reviewing the code carefully to prevent bac actors.
17+
- When merging dependabot PRs, make sure to review the changes in the PR and to check the authenticity of the bot account.
18+
19+
### TODO
1420

1521
- Communication
1622
- Workflow
1723
- Versioning
1824
- Issuing new releases
1925
- Updating the Changelog
2026
- Granting Rubygems access
21-
- Labels
27+
- Labeling Issues and PRs

0 commit comments

Comments
 (0)