Skip to content

Commit

Permalink
refactor(git)!: remove v8 deprecated git method (#2716)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinigami92 authored Mar 6, 2024
1 parent 2716865 commit b3afc8f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 23 deletions.
7 changes: 7 additions & 0 deletions docs/guide/upgrading_v9/2716.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
### Remove deprecated git method

Removed deprecated git method

| old | replacement |
| ---------------------- | ------------------------------------ |
| `faker.git.shortSha()` | `faker.git.commitSha({ length: 7 })` |
23 changes: 2 additions & 21 deletions src/modules/git/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { deprecated } from '../../internal/deprecated';
import { ModuleBase } from '../../internal/module-base';

const nbsp = '\u00A0';
Expand Down Expand Up @@ -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
*/
Expand All @@ -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 });
}
}
2 changes: 0 additions & 2 deletions test/modules/git.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ describe('git', () => {
.it('with length 8', { length: 8 });
});

t.skip('shortSha');

t.describeEach(
'commitEntry',
'commitDate'
Expand Down

0 comments on commit b3afc8f

Please sign in to comment.