From b3afc8f351003cf9df9984fb5be6cd46e18f71d8 Mon Sep 17 00:00:00 2001 From: Shinigami Date: Wed, 6 Mar 2024 17:50:00 +0100 Subject: [PATCH] refactor(git)!: remove v8 deprecated git method (#2716) --- docs/guide/upgrading_v9/2716.md | 7 +++++++ src/modules/git/index.ts | 23 ++--------------------- test/modules/git.spec.ts | 2 -- 3 files changed, 9 insertions(+), 23 deletions(-) create mode 100644 docs/guide/upgrading_v9/2716.md diff --git a/docs/guide/upgrading_v9/2716.md b/docs/guide/upgrading_v9/2716.md new file mode 100644 index 00000000000..8f24100c14e --- /dev/null +++ b/docs/guide/upgrading_v9/2716.md @@ -0,0 +1,7 @@ +### Remove deprecated git method + +Removed deprecated git method + +| old | replacement | +| ---------------------- | ------------------------------------ | +| `faker.git.shortSha()` | `faker.git.commitSha({ length: 7 })` | diff --git a/src/modules/git/index.ts b/src/modules/git/index.ts index 0c50b6146e8..8f33f0c5484 100644 --- a/src/modules/git/index.ts +++ b/src/modules/git/index.ts @@ -1,4 +1,3 @@ -import { deprecated } from '../../internal/deprecated'; import { ModuleBase } from '../../internal/module-base'; const nbsp = '\u00A0'; @@ -196,6 +195,8 @@ export class GitModule extends ModuleBase { * * @example * faker.git.commitSha() // '2c6e3880fd94ddb7ef72d34e683cdc0c47bec6e6' + * faker.git.commitSha({ length: 7 }) // 'dbee57b' + * faker.git.commitSha({ length: 8 }) // '0e52376a' * * @since 5.0.0 */ @@ -216,24 +217,4 @@ export class GitModule extends ModuleBase { prefix: '', }); } - - /** - * Generates a random commit sha (short). - * - * @example - * faker.git.shortSha() // '6155732' - * - * @since 5.0.0 - * - * @deprecated Use `faker.git.commitSha({ length: 7 })` instead. - */ - shortSha(): string { - deprecated({ - deprecated: 'faker.git.shortSha()', - proposed: 'faker.git.commitSha({ length: 7 })', - since: '8.0', - until: '9.0', - }); - return this.commitSha({ length: 7 }); - } } diff --git a/test/modules/git.spec.ts b/test/modules/git.spec.ts index b120cc09cd8..8957e99566b 100644 --- a/test/modules/git.spec.ts +++ b/test/modules/git.spec.ts @@ -18,8 +18,6 @@ describe('git', () => { .it('with length 8', { length: 8 }); }); - t.skip('shortSha'); - t.describeEach( 'commitEntry', 'commitDate'