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
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+14-6Lines changed: 14 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,6 @@ We are always happy to make improvements to Faker. There are many ways to contri
4
4
5
5
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.
6
6
7
-
8
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:
9
8
10
9
- Fork this repo and clone your fork to somewhere on your machine.
@@ -64,24 +63,32 @@ Please follow these guidelines when adding new code:
64
63
There are a few ways to run RuboCop:
65
64
66
65
```ruby
67
-
`bundle exec rubocop`#-> to only run Rubocop
66
+
`bundle exec rubocop`#-> to run Rubocop only
68
67
69
68
`bundle exec rake`#-> to run the test suite and rubocop after.
70
69
```
71
70
72
71
## Managing your branch
73
72
74
73
- 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).
75
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.
76
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).
77
77
78
78
## Adding new generators
79
79
80
80
### General Guidelines
81
81
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.
83
89
- 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.
85
92
- 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
93
- 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.
87
94
@@ -90,7 +97,8 @@ There are a few ways to run RuboCop:
90
97
Add the new generator to the [Generators list in the README](./README.md#generators) so other people can find them.
91
98
92
99
#### YARD docs
93
-
- Include [YARD] style docs for all methods that includes:
100
+
101
+
Include [YARD] style docs for all methods that includes:
94
102
- A short description of what the method generates
95
103
- Descriptions for all params (`@param`)
96
104
- The return type (`@return`)
@@ -169,7 +177,7 @@ When in doubt, run `bundle exec rake reformat_yaml['lib/path/to/file.yml']` to r
169
177
* Use the `rake console` task to start a session with Faker loaded.
170
178
* Use `bundle exec yard server -r` to launch the YARD Doc server.
171
179
172
-
## A word on the changelog
180
+
## A word on the Changelog
173
181
174
182
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!
Copy file name to clipboardExpand all lines: MAINTAINING.md
+9-3Lines changed: 9 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
###Maintaining Faker
1
+
## Maintaining faker-ruby
2
2
3
3
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.
4
4
@@ -10,12 +10,18 @@ If you're reviewing a PR, you should ask yourself:
10
10
> * Is it well documented?
11
11
> * Is it following the structure of the project?
12
12
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.
0 commit comments