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

chore: deprecate address.streetPrefix and suffix #1053

Merged
merged 7 commits into from
Jul 30, 2022

Conversation

ST-DDT
Copy link
Member

@ST-DDT ST-DDT commented Jun 10, 2022

The street prefix and suffix methods only generate parts of the data and not all of the locales support these.
IMO the methods aren't useful by themselves and thus should be removed.

@ST-DDT ST-DDT added c: chore PR that doesn't affect the runtime behavior p: 1-normal Nothing urgent labels Jun 10, 2022
@ST-DDT ST-DDT added this to the v7 - Current Major milestone Jun 10, 2022
@ST-DDT ST-DDT requested review from a team June 10, 2022 22:29
@ST-DDT ST-DDT self-assigned this Jun 10, 2022
@codecov
Copy link

codecov bot commented Jun 10, 2022

Codecov Report

Merging #1053 (81de721) into main (a65f1a2) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head 81de721 differs from pull request most recent head db356d0. Consider uploading reports for the commit db356d0 to get more accurate results

@@            Coverage Diff             @@
##             main    #1053      +/-   ##
==========================================
- Coverage   99.62%   99.62%   -0.01%     
==========================================
  Files        2153     2153              
  Lines      236493   236512      +19     
  Branches      976      975       -1     
==========================================
+ Hits       235605   235621      +16     
- Misses        867      870       +3     
  Partials       21       21              
Impacted Files Coverage Δ
src/modules/random/index.ts 98.13% <ø> (-0.01%) ⬇️
src/locales/af_ZA/address/street.ts 100.00% <100.00%> (ø)
src/locales/de_CH/address/street.ts 100.00% <100.00%> (ø)
src/locales/el/address/street.ts 100.00% <100.00%> (ø)
src/locales/en_AU/address/street.ts 100.00% <100.00%> (ø)
src/locales/en_CA/address/street.ts 100.00% <100.00%> (ø)
src/locales/en_GB/address/street.ts 100.00% <100.00%> (ø)
src/locales/en_IE/address/street.ts 100.00% <100.00%> (ø)
src/locales/en_IND/address/street.ts 100.00% <100.00%> (ø)
src/locales/en_NG/address/street.ts 100.00% <100.00%> (ø)
... and 9 more

@xDivisionByZerox
Copy link
Member

IMO either keep them as util functions (for custom tooling) or remove them completely, like don't advertise the usage with faker.fake(). Doesn't make sense to me to tell the user "hey can still use this, but not as nice as it was for now" (write a "complex" non-typesafe string).

@ST-DDT
Copy link
Member Author

ST-DDT commented Jun 13, 2022

IMO either keep them as util functions (for custom tooling) or remove them completely, like don't advertise the usage with faker.fake().

I do want to remove them, but I want to give everyone a chance to migrate.
I could switch to faker.helpers.arrayElement(faker.definitions.address.street_prefix), but that is way longer.
The current usages of these methods are mostly limited to faker.fake(), so thats why I have chosen that one.

@xDivisionByZerox
Copy link
Member

I do want to remove them, but I want to give everyone a chance to migrate.
I could switch to faker.helpers.arrayElement(faker.definitions.address.street_prefix), but that is way longer.
The current usages of these methods are mostly limited to faker.fake(), so thats why I have chosen that one.

Nah, I think you misunderstood me. If we deprecate these functions, why leave the definitions?

@ST-DDT
Copy link
Member Author

ST-DDT commented Jun 13, 2022

If we deprecate these functions, why leave the definitions?

To give users a hint how they should structure their definitions to be compatible with our format/our existing locales.
If possible I still want all locales to have the same set of used files.
But there might be other/better ways to achieve that (e.g. a file-name whitelist, so it's easier to tell when a file is added that doesn't match our existing files).

Shinigami92
Shinigami92 previously approved these changes Jun 14, 2022
Copy link
Member

@Shinigami92 Shinigami92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO it is okay to remove / hide this from the end-user as I would not know what a street suffix/prefix would even be 🤷
We also didn't explain it anywhere but just provide it
In the end Faker should be a tool to generate meaningful data, and streetnames are totally okay, but what is a street prefix/suffix?

test/random.spec.ts Outdated Show resolved Hide resolved
@Shinigami92 Shinigami92 added the needs rebase There is a merge conflict label Jul 1, 2022
@ST-DDT ST-DDT force-pushed the deprecate/address/street/prefix-suffix branch from 2930bdf to 6b76c86 Compare July 2, 2022 20:50
@ST-DDT ST-DDT removed the needs rebase There is a merge conflict label Jul 2, 2022
@ST-DDT ST-DDT requested review from a team July 2, 2022 20:52
import-brain
import-brain previously approved these changes Jul 14, 2022
@xDivisionByZerox xDivisionByZerox added m: location Something is referring to the location module needs rebase There is a merge conflict labels Jul 28, 2022
@ST-DDT ST-DDT force-pushed the deprecate/address/street/prefix-suffix branch from d6d86ff to d5e4332 Compare July 29, 2022 21:14
@ST-DDT ST-DDT removed the needs rebase There is a merge conflict label Jul 29, 2022
@ST-DDT ST-DDT requested a review from a team July 29, 2022 21:28
@ST-DDT ST-DDT enabled auto-merge (squash) July 29, 2022 21:28
pkuczynski
pkuczynski previously approved these changes Jul 29, 2022
@ST-DDT ST-DDT dismissed stale reviews from pkuczynski and xDivisionByZerox via 81de721 July 30, 2022 17:33
@ST-DDT ST-DDT requested review from a team July 30, 2022 17:45
@ST-DDT ST-DDT merged commit ef6fbac into main Jul 30, 2022
@ST-DDT ST-DDT deleted the deprecate/address/street/prefix-suffix branch July 30, 2022 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: chore PR that doesn't affect the runtime behavior m: location Something is referring to the location module p: 1-normal Nothing urgent
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants