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(git)!: remove v8 deprecated git method #2716

Merged
merged 4 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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