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

refactor!: cleanup deprecations #1440

Merged
merged 12 commits into from
Oct 14, 2022
Merged

refactor!: cleanup deprecations #1440

merged 12 commits into from
Oct 14, 2022

Conversation

Shinigami92
Copy link
Member

closes #1439

@Shinigami92 Shinigami92 added p: 1-normal Nothing urgent c: refactor PR that affects the runtime behavior, but doesn't add new features or fixes bugs breaking change Cannot be merged when next version is not a major release labels Oct 13, 2022
@Shinigami92 Shinigami92 self-assigned this Oct 13, 2022
@codecov
Copy link

codecov bot commented Oct 13, 2022

Codecov Report

Merging #1440 (fc9b9c8) into next (1ab33c5) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             next    #1440      +/-   ##
==========================================
- Coverage   99.62%   99.61%   -0.02%     
==========================================
  Files        2166     2164       -2     
  Lines      237450   236816     -634     
  Branches     1044     1001      -43     
==========================================
- Hits       236567   235898     -669     
- Misses        862      896      +34     
- Partials       21       22       +1     
Impacted Files Coverage Δ
src/modules/commerce/index.ts 100.00% <ø> (ø)
src/modules/helpers/index.ts 98.44% <ø> (-0.07%) ⬇️
src/modules/image/providers/lorempicsum.ts 93.85% <ø> (-1.00%) ⬇️
src/modules/image/providers/lorempixel.ts 91.30% <ø> (-0.65%) ⬇️
src/modules/image/providers/unsplash.ts 100.00% <ø> (+4.67%) ⬆️
src/modules/phone/index.ts 100.00% <ø> (ø)
src/faker.ts 100.00% <100.00%> (ø)
src/index.ts 100.00% <100.00%> (ø)
src/modules/address/index.ts 99.78% <100.00%> (-0.05%) ⬇️
src/modules/company/index.ts 100.00% <100.00%> (ø)
... and 7 more

@Shinigami92 Shinigami92 marked this pull request as ready for review October 13, 2022 18:09
@Shinigami92 Shinigami92 requested a review from a team October 13, 2022 18:09
@Shinigami92 Shinigami92 requested a review from a team as a code owner October 13, 2022 18:09
src/index.ts Outdated Show resolved Hide resolved
test/address.spec.ts Outdated Show resolved Hide resolved
test/company.spec.ts Outdated Show resolved Hide resolved
test/phone.spec.ts Outdated Show resolved Hide resolved
test/phone.spec.ts Outdated Show resolved Hide resolved
@Shinigami92 Shinigami92 marked this pull request as draft October 14, 2022 06:57
Co-authored-by: ST-DDT <ST-DDT@gmx.de>
@Shinigami92 Shinigami92 requested review from ST-DDT and a team October 14, 2022 07:10
@Shinigami92 Shinigami92 marked this pull request as ready for review October 14, 2022 07:13
src/modules/address/index.ts Outdated Show resolved Hide resolved
src/modules/company/index.ts Outdated Show resolved Hide resolved
Co-authored-by: ST-DDT <ST-DDT@gmx.de>
ST-DDT
ST-DDT previously approved these changes Oct 14, 2022
@xDivisionByZerox
Copy link
Member

How do we handle this as it is marked for removal in v8.0?

streetName(): string {
if (this.faker.definitions.address.street_name == null) {
deprecated({
deprecated:
'faker.address.streetName() without address.street_name definitions',
proposed:
'faker.address.street() or provide address.street_name definitions',
since: '7.0',
until: '8.0',
});
return this.street();
}
return this.faker.helpers.arrayElement(
this.faker.definitions.address.street_name
);
}

Copy link
Member

@xDivisionByZerox xDivisionByZerox left a comment

Choose a reason for hiding this comment

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

You missed this on:

hexadecimal(
options:
| { length?: number; prefix?: string; case?: 'lower' | 'upper' | 'mixed' }
| number = {}
): string {
if (typeof options === 'number') {
deprecated({
deprecated: 'faker.datatype.hexadecimal(length)',
proposed: 'faker.datatype.hexadecimal({ length })',
since: '7.5',
until: '8.0',
});
options = {
length: options,
};
}

import-brain
import-brain previously approved these changes Oct 14, 2022
@import-brain
Copy link
Member

You missed this on:

hexadecimal(
options:
| { length?: number; prefix?: string; case?: 'lower' | 'upper' | 'mixed' }
| number = {}
): string {
if (typeof options === 'number') {
deprecated({
deprecated: 'faker.datatype.hexadecimal(length)',
proposed: 'faker.datatype.hexadecimal({ length })',
since: '7.5',
until: '8.0',
});
options = {
length: options,
};
}

Good catch.

@Shinigami92 Shinigami92 dismissed stale reviews from import-brain and ST-DDT via fc9b9c8 October 14, 2022 18:27
@Shinigami92
Copy link
Member Author

@xDivisionByZerox nice catch!
I also found streetName 👍

@Shinigami92 Shinigami92 merged commit 9c1437d into next Oct 14, 2022
@ST-DDT ST-DDT deleted the cleanup-deprecations branch October 14, 2022 19:29
wael-fadlallah pushed a commit to wael-fadlallah/faker that referenced this pull request Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Cannot be merged when next version is not a major release c: refactor PR that affects the runtime behavior, but doesn't add new features or fixes bugs p: 1-normal Nothing urgent
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Remove @deprecated code
4 participants