Repository navigation
Added pronouns provider - #1106
Conversation
PR Summary
|
| - "Tem" | ||
| - "Em" | ||
| possessive: | ||
| - "Her" |
| possessive: | ||
| - "Her" | ||
| - "His" | ||
| - "Their" |
|
it seems it should be rebased since there are conflicts |
|
@snuyanzin should we start a discussion about the artifact release? From my view, this PR will get merged but not be available until you guys release a new artifact. Should the version increase automatically and be released when the PR is merged? I'm curious about the release process, and also happy to help. |
|
On merge it'll be snapshot yes and available that way. Otherwise yes it'll have to wait for a release. |
There was a problem hiding this comment.
This file shouldn't be changed. 2.1.0 was already released
There was a problem hiding this comment.
Seems this change was maybe done on a outdated branch?
There was a problem hiding this comment.
That's right. I just pushed the merge conflict fix
| | [Pokemon](https://javadoc.io/doc/net.datafaker/datafaker/latest/net/datafaker/providers/entertainment/Pokemon.html) | | Entertainment | 0.8.0 | | ||
| | [Princess Bride](https://javadoc.io/doc/net.datafaker/datafaker/latest/net/datafaker/providers/entertainment/PrincessBride.html) | | Entertainment | 0.8.0 | | ||
| | [Programming Language](https://javadoc.io/doc/net.datafaker/datafaker/latest/net/datafaker/providers/base/ProgrammingLanguage.html) | | Base | 0.8.0 | | ||
| | [Pronouns](https://javadoc.io/doc/net.datafaker/datafaker/latest/net/datafaker/providers/base/Pronouns.html) | Gender pronouns are the set of pronouns that an individual uses to reflect that person's own gender identity | Base | 2.1.0 | |
There was a problem hiding this comment.
This shouldn't be modified this is part of the release tasks (IIRC)
There was a problem hiding this comment.
Correct, but it doesn't hurt.
There was a problem hiding this comment.
That's one of the points about release. The code, doc, and version will be there without the artifact generated and publicly available.
I can follow any recommendation.
|
|
||
| /** | ||
| * This class generates gender neutral pronouns | ||
| * @since 2.1.0 |
There was a problem hiding this comment.
I believe the next release is slated to be 2.2.0
There was a problem hiding this comment.
Waiting for the resolution of this comment #1106 (comment)
|
You could add it to the 'full list' in the readme. |
| subjective: | ||
| - "She" | ||
| - "He" | ||
| - "They" |
There was a problem hiding this comment.
I'm wondering if these things should be uppercased?
| * This class generates gender neutral pronouns | ||
| * @since 2.1.0 | ||
| */ | ||
| public class Pronouns extends AbstractProvider<BaseProviders> { |
There was a problem hiding this comment.
Any reason why a new class is used, and not add it to Gender? Gender seems like a reasonable place for this, or not?
There was a problem hiding this comment.
That's a good question.
I'm trying to follow the same pattern as the other " self-contained " providers. They have not implemented the fluent interface approach as I could call the class itself or another class.
Example:
faker.gender().pronouns().subjective();The example above would be implemented in this way:
- The
Pronounsclass still exists - The
Genderclass would have a pronouns() method returning its new instance
public class Gender extends AbstractProvider<BaseProviders> {
// ignoring already existing code
public Pronouns pronouns() {
return new Pronouns(faker);
}
}- The
Pronounsclass as a defaulttoString()in the case the consumer would call only its method
faker.gender().pronouns()I'm open to any implementation ideas :-)
There was a problem hiding this comment.
@bodiam any feedback about this last comment?
There was a problem hiding this comment.
same could achieved with
public Pronouns pronouns() {
return faker.getPronouns();
}however no need to make GC happy by creation a new object each time there is a call to pronouns
There was a problem hiding this comment.
@eliasnogueira it's a bit comment, not sure what to say :-) I'm not a fan of the fluent interface approach that much, so if you want to keep the Pronouns as a separate class, that's fine.
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #1106 +/- ##
============================================
- Coverage 92.35% 92.32% -0.03%
- Complexity 2821 2828 +7
============================================
Files 292 293 +1
Lines 5609 5618 +9
Branches 599 599
============================================
+ Hits 5180 5187 +7
Misses 275 275
- Partials 154 156 +2 ☔ View full report in Codecov by Sentry. |
| | 2.1.0 | 4 | 237 | | ||
|
|
||
| Datafaker comes with a total of 233 data providers: | ||
| Datafaker comes with a total of 237 data providers: |
There was a problem hiding this comment.
this document is auto generated, no need to update.
|
Anyone objecting if I merge this? |
|
Go for it |
|
Thanks @eliasnogueira et al for the work on this! |
|
Thank you guys! |
Description
This PR adds a new provider: Pronouns.
Questions
Question 1
I don't know the release process, so I added this new provider as a 2.1.0 version.
Should we change it to 2.1.1, if it gets merged, or wait until the next release?
Question 3
Should we add it as part of the
Nameprovider?