Skip to content

Commit d9b9cb4

Browse files
committed
chore: format
1 parent 2afff5c commit d9b9cb4

File tree

1 file changed

+5
-20
lines changed

1 file changed

+5
-20
lines changed

scripts/husky/pre-commit.mjs

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,9 @@ export function getPatterns() {
2121
const entries = patterns;
2222
for (const [language, { tests }] of Object.entries(clientConfig)) {
2323
entries.unshift(`tests/output/${language}/${tests.outputFolder}/client/**`);
24-
entries.unshift(
25-
`tests/output/${language}/${tests.outputFolder}/requests/**`,
26-
);
24+
entries.unshift(`tests/output/${language}/${tests.outputFolder}/requests/**`);
2725
entries.unshift(`tests/output/${language}/${tests.outputFolder}/e2e/**`);
28-
entries.unshift(
29-
`tests/output/${language}/${tests.outputFolder}/benchmark/**`,
30-
);
26+
entries.unshift(`tests/output/${language}/${tests.outputFolder}/benchmark/**`);
3127
}
3228
return entries;
3329
}
@@ -38,9 +34,7 @@ async function preCommit(log) {
3834
await run('git merge HEAD');
3935
} catch (e) {
4036
if (e.exitCode === 128) {
41-
console.log(
42-
'Skipping the pre-commit check because a merge is in progress',
43-
);
37+
console.log('Skipping the pre-commit check because a merge is in progress');
4438
return;
4539
}
4640
}
@@ -50,13 +44,7 @@ async function preCommit(log) {
5044
const toUnstage = micromatch.match(stagedFiles, getPatterns());
5145

5246
// the snippets and guides are yarn workspaces, so the yarn.lock file can change when they are updated, but the CI will take care of it
53-
if (
54-
(
55-
await run(
56-
'git diff --name-only --cached -- {guides,snippet}/javascript | wc -l',
57-
)
58-
).trim() !== '0'
59-
) {
47+
if ((await run('git diff --name-only --cached -- {guides,snippet}/javascript | wc -l')).trim() !== '0') {
6048
toUnstage.push('yarn.lock');
6149
}
6250

@@ -66,10 +54,7 @@ async function preCommit(log) {
6654

6755
if (log) {
6856
toUnstage.forEach((file) =>
69-
console.log(
70-
chalk.black.bgYellow('[INFO]'),
71-
`Generated file found, unstaging: ${file}`,
72-
),
57+
console.log(chalk.black.bgYellow('[INFO]'), `Generated file found, unstaging: ${file}`),
7358
);
7459
}
7560
await run(`git restore --staged ${toUnstage.join(' ')}`);

0 commit comments

Comments
 (0)