Skip to content

Commit 905f113

Browse files
greenkeeper[bot]pvdlg
authored andcommitted
chore(package): update xo to version 0.28.0
1 parent 45b4830 commit 905f113

File tree

3 files changed

+37
-31
lines changed

3 files changed

+37
-31
lines changed

lib/git.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ const debug = require('debug')('semantic-release:git');
88
*
99
* @return {Array<String>} Array of modified files path.
1010
*/
11-
async function getModifiedFiles(execaOpts) {
12-
return (await execa('git', ['ls-files', '-m', '-o'], execaOpts)).stdout
11+
async function getModifiedFiles(execaOptions) {
12+
return (await execa('git', ['ls-files', '-m', '-o'], execaOptions)).stdout
1313
.split('\n')
1414
.map(file => file.trim())
1515
.filter(file => Boolean(file));
@@ -21,8 +21,8 @@ async function getModifiedFiles(execaOpts) {
2121
* @param {Array<String>} files Array of files path to add to the index.
2222
* @param {Object} [execaOpts] Options to pass to `execa`.
2323
*/
24-
async function add(files, execaOpts) {
25-
const shell = await execa('git', ['add', '--force', '--ignore-errors', ...files], {...execaOpts, reject: false});
24+
async function add(files, execaOptions) {
25+
const shell = await execa('git', ['add', '--force', '--ignore-errors', ...files], {...execaOptions, reject: false});
2626
debug('add file to git index', shell);
2727
}
2828

@@ -34,8 +34,8 @@ async function add(files, execaOpts) {
3434
*
3535
* @throws {Error} if the commit failed.
3636
*/
37-
async function commit(message, execaOpts) {
38-
await execa('git', ['commit', '-m', message], execaOpts);
37+
async function commit(message, execaOptions) {
38+
await execa('git', ['commit', '-m', message], execaOptions);
3939
}
4040

4141
/**
@@ -47,8 +47,8 @@ async function commit(message, execaOpts) {
4747
*
4848
* @throws {Error} if the push failed.
4949
*/
50-
async function push(origin, branch, execaOpts) {
51-
await execa('git', ['push', '--tags', origin, `HEAD:${branch}`], execaOpts);
50+
async function push(origin, branch, execaOptions) {
51+
await execa('git', ['push', '--tags', origin, `HEAD:${branch}`], execaOptions);
5252
}
5353

5454
/**
@@ -58,8 +58,8 @@ async function push(origin, branch, execaOpts) {
5858
*
5959
* @return {String} The sha of the head commit on the local repository
6060
*/
61-
async function gitHead(execaOpts) {
62-
return (await execa('git', ['rev-parse', 'HEAD'], execaOpts)).stdout;
61+
async function gitHead(execaOptions) {
62+
return (await execa('git', ['rev-parse', 'HEAD'], execaOptions)).stdout;
6363
}
6464

6565
module.exports = {getModifiedFiles, add, gitHead, commit, push};

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"semantic-release": "^17.0.0",
3838
"sinon": "^9.0.0",
3939
"tempy": "^0.5.0",
40-
"xo": "^0.27.0"
40+
"xo": "^0.28.0"
4141
},
4242
"engines": {
4343
"node": ">=10.18"
@@ -94,6 +94,9 @@
9494
},
9595
"xo": {
9696
"prettier": true,
97-
"space": true
97+
"space": true,
98+
"rules": {
99+
"unicorn/string-content": "off"
100+
}
98101
}
99102
}

test/helpers/git-utils.js

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,13 @@ async function initBareRepo(repositoryUrl, branch = 'master') {
5959
*
6060
* @returns {Array<Commit>} The created commits, in reverse order (to match `git log` order).
6161
*/
62-
async function gitCommits(messages, execaOpts) {
62+
async function gitCommits(messages, execaOptions) {
6363
await pReduce(
6464
messages,
6565
async (_, message) =>
66-
(await execa('git', ['commit', '-m', message, '--allow-empty', '--no-gpg-sign'], execaOpts)).stdout
66+
(await execa('git', ['commit', '-m', message, '--allow-empty', '--no-gpg-sign'], execaOptions)).stdout
6767
);
68-
return (await gitGetCommits(undefined, execaOpts)).slice(0, messages.length);
68+
return (await gitGetCommits(undefined, execaOptions)).slice(0, messages.length);
6969
}
7070

7171
/**
@@ -76,11 +76,14 @@ async function gitCommits(messages, execaOpts) {
7676
*
7777
* @return {Array<Object>} The list of parsed commits.
7878
*/
79-
async function gitGetCommits(from, execaOpts) {
79+
async function gitGetCommits(from, execaOptions) {
8080
Object.assign(gitLogParser.fields, {hash: 'H', message: 'B', gitTags: 'd', committerDate: {key: 'ci', type: Date}});
8181
return (
8282
await getStream.array(
83-
gitLogParser.parse({_: `${from ? from + '..' : ''}HEAD`}, {...execaOpts, env: {...process.env, ...execaOpts.env}})
83+
gitLogParser.parse(
84+
{_: `${from ? from + '..' : ''}HEAD`},
85+
{...execaOptions, env: {...process.env, ...execaOptions.env}}
86+
)
8487
)
8588
).map(commit => {
8689
commit.message = commit.message.trim();
@@ -96,8 +99,8 @@ async function gitGetCommits(from, execaOpts) {
9699
* @param {Boolean} create to create the branch, `false` to checkout an existing branch.
97100
* @param {Object} [execaOpts] Options to pass to `execa`.
98101
*/
99-
async function gitCheckout(branch, create, execaOpts) {
100-
await execa('git', create ? ['checkout', '-b', branch] : ['checkout', branch], execaOpts);
102+
async function gitCheckout(branch, create, execaOptions) {
103+
await execa('git', create ? ['checkout', '-b', branch] : ['checkout', branch], execaOptions);
101104
}
102105

103106
/**
@@ -107,8 +110,8 @@ async function gitCheckout(branch, create, execaOpts) {
107110
* @param {String} [sha] The commit on which to create the tag. If undefined the tag is created on the last commit.
108111
* @param {Object} [execaOpts] Options to pass to `execa`.
109112
*/
110-
async function gitTagVersion(tagName, sha, execaOpts) {
111-
await execa('git', sha ? ['tag', '-f', tagName, sha] : ['tag', tagName], execaOpts);
113+
async function gitTagVersion(tagName, sha, execaOptions) {
114+
await execa('git', sha ? ['tag', '-f', tagName, sha] : ['tag', tagName], execaOptions);
112115
}
113116

114117
/**
@@ -154,8 +157,8 @@ async function gitDetachedHead(repositoryUrl, head) {
154157
*
155158
* @return {String} The HEAD sha of the remote repository.
156159
*/
157-
async function gitRemoteHead(repositoryUrl, execaOpts) {
158-
return (await execa('git', ['ls-remote', repositoryUrl, 'HEAD'], execaOpts)).stdout
160+
async function gitRemoteHead(repositoryUrl, execaOptions) {
161+
return (await execa('git', ['ls-remote', repositoryUrl, 'HEAD'], execaOptions)).stdout
159162
.split('\n')
160163
.filter(head => Boolean(head))
161164
.map(head => head.match(/^(?<head>\S+)/)[1])[0];
@@ -168,8 +171,8 @@ async function gitRemoteHead(repositoryUrl, execaOpts) {
168171
*
169172
* @return {Array<String>} Array of staged files path.
170173
*/
171-
async function gitStaged(execaOpts) {
172-
return (await execa('git', ['status', '--porcelain'], execaOpts)).stdout
174+
async function gitStaged(execaOptions) {
175+
return (await execa('git', ['status', '--porcelain'], execaOptions)).stdout
173176
.split('\n')
174177
.filter(status => status.startsWith('A '))
175178
.map(status => status.match(/^A\s+(?<file>.+)$/)[1]);
@@ -183,8 +186,8 @@ async function gitStaged(execaOpts) {
183186
*
184187
* @return {Array<String>} The list of files path included in the commit.
185188
*/
186-
async function gitCommitedFiles(ref, execaOpts) {
187-
return (await execa('git', ['diff-tree', '-r', '--name-only', '--no-commit-id', '-r', ref], execaOpts)).stdout
189+
async function gitCommitedFiles(ref, execaOptions) {
190+
return (await execa('git', ['diff-tree', '-r', '--name-only', '--no-commit-id', '-r', ref], execaOptions)).stdout
188191
.split('\n')
189192
.filter(file => Boolean(file));
190193
}
@@ -195,8 +198,8 @@ async function gitCommitedFiles(ref, execaOpts) {
195198
* @param {Array<String>} files Array of files path to add to the index.
196199
* @param {Object} [execaOpts] Options to pass to `execa`.
197200
*/
198-
async function gitAdd(files, execaOpts) {
199-
await execa('git', ['add', '--force', '--ignore-errors', ...files], {...execaOpts});
201+
async function gitAdd(files, execaOptions) {
202+
await execa('git', ['add', '--force', '--ignore-errors', ...files], {...execaOptions});
200203
}
201204

202205
/**
@@ -206,8 +209,8 @@ async function gitAdd(files, execaOpts) {
206209
* @param {String} branch The branch to push.
207210
* @param {Object} [execaOpts] Options to pass to `execa`.
208211
*/
209-
async function gitPush(repositoryUrl, branch, execaOpts) {
210-
await execa('git', ['push', '--tags', repositoryUrl, `HEAD:${branch}`], execaOpts);
212+
async function gitPush(repositoryUrl, branch, execaOptions) {
213+
await execa('git', ['push', '--tags', repositoryUrl, `HEAD:${branch}`], execaOptions);
211214
}
212215

213216
module.exports = {

0 commit comments

Comments
 (0)