Skip to content

Commit 64492ce

Browse files
committed
feature: @putout/plugin-github: use @putout/printer
1 parent 2194abd commit 64492ce

25 files changed

+347
-412
lines changed

packages/plugin-github/.madrun.mjs

-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,3 @@ export default {
1010
'coverage': async () => `c8 ${await run('test')}`,
1111
'report': () => 'c8 report --reporter=lcov',
1212
};
13-

packages/plugin-github/.putout.json

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"printer": "putout",
23
"match": {
34
"lib/index.js": {
45
"remove-useless-spread/object": "off"

packages/plugin-github/lib/index.js

-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,3 @@ module.exports.rules = {
1010
...getRule('set-setup-node-version'),
1111
...getRule('set-add-and-commit'),
1212
};
13-
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
__putout_processor_json({
2-
"jobs": {
3-
"build": {
4-
"runs-on": "ubuntu-latest",
5-
"steps": [
6-
{
7-
"uses": 'EndBug/add-and-commit@v9'
8-
},
9-
]
10-
}
11-
}
2+
"jobs": {
3+
"build": {
4+
"runs-on": "ubuntu-latest",
5+
"steps": [{
6+
"uses": 'EndBug/add-and-commit@v9',
7+
}],
8+
},
9+
},
1210
});

packages/plugin-github/lib/set-add-and-commit/index.spec.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ const {createTest} = require('@putout/test');
44
const setAddAndCommit = require('.');
55

66
const test = createTest(__dirname, {
7-
'github/set-add-and-commit': setAddAndCommit,
7+
printer: 'putout',
8+
plugins: [
9+
['github/set-add-and-commit', setAddAndCommit],
10+
],
811
});
912

1013
test('plugin-github: set-set-add-and-commit: report', (t) => {
@@ -26,4 +29,3 @@ test('plugin-github: set-set-add-and-commit: no report: more', (t) => {
2629
t.noReport('more');
2730
t.end();
2831
});
29-
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,39 @@
11
__putout_processor_json({
2-
"name": "Node CI",
3-
"on": [
4-
"push",
5-
"pull_request"
6-
],
7-
"jobs": {
8-
"build": {
9-
"runs-on": "ubuntu-latest",
10-
"steps": [
11-
{
12-
"uses": 'actions/checkout@v3'
13-
},
14-
{
15-
"name": "Use Node.js ${{ matrix.node-version }}",
16-
"uses": "actions/setup-node@v1",
17-
"with": {
18-
"node-version": "${{ matrix.node-version }}"
19-
}
20-
},
21-
{
22-
"name": "Install Redrun",
23-
"run": "npm i redrun -g"
24-
},
25-
{
26-
"name": "Install",
27-
"run": "npm install"
28-
},
29-
{
30-
"name": "Bootstrap",
31-
"run": "redrun bootstrap"
32-
},
33-
{
34-
"name": "Lint",
35-
"run": "redrun lint"
36-
},
37-
{
38-
"name": "Coverage",
39-
"run": "redrun coverage report"
40-
},
41-
{
42-
"name": "Coveralls",
43-
"uses": "coverallsapp/github-action@master",
44-
"with": {
45-
"github-token": "${{ secrets.GITHUB_TOKEN }}"
46-
}
47-
}
48-
]
49-
}
50-
}
2+
"name": "Node CI",
3+
"on": ["push", "pull_request"],
4+
"jobs": {
5+
"build": {
6+
"runs-on": "ubuntu-latest",
7+
"steps": [{
8+
"uses": 'actions/checkout@v3',
9+
}, {
10+
"name": "Use Node.js ${{ matrix.node-version }}",
11+
"uses": "actions/setup-node@v1",
12+
"with": {
13+
"node-version": "${{ matrix.node-version }}",
14+
},
15+
}, {
16+
"name": "Install Redrun",
17+
"run": "npm i redrun -g",
18+
}, {
19+
"name": "Install",
20+
"run": "npm install",
21+
}, {
22+
"name": "Bootstrap",
23+
"run": "redrun bootstrap",
24+
}, {
25+
"name": "Lint",
26+
"run": "redrun lint",
27+
}, {
28+
"name": "Coverage",
29+
"run": "redrun coverage report",
30+
}, {
31+
"name": "Coveralls",
32+
"uses": "coverallsapp/github-action@master",
33+
"with": {
34+
"github-token": "${{ secrets.GITHUB_TOKEN }}",
35+
},
36+
}],
37+
},
38+
},
5139
});
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,39 @@
11
__putout_processor_json({
2-
"name": "Node CI",
3-
"on": [
4-
"push",
5-
"pull_request"
6-
],
7-
"jobs": {
8-
"build": {
9-
"runs-on": "ubuntu-latest",
10-
"steps": [
11-
{
12-
"uses": 'actions/checkout@v3'
13-
},
14-
{
15-
"name": "Use Node.js ${{ matrix.node-version }}",
16-
"uses": "actions/setup-node@v1",
17-
"with": {
18-
"node-version": "${{ matrix.node-version }}"
19-
}
20-
},
21-
{
22-
"name": "Install Redrun",
23-
"run": "npm i redrun -g"
24-
},
25-
{
26-
"name": "Install",
27-
"run": "npm install"
28-
},
29-
{
30-
"name": "Bootstrap",
31-
"run": "redrun bootstrap"
32-
},
33-
{
34-
"name": "Lint",
35-
"run": "redrun lint"
36-
},
37-
{
38-
"name": "Coverage",
39-
"run": "redrun coverage report"
40-
},
41-
{
42-
"name": "Coveralls",
43-
"uses": "coverallsapp/github-action@master",
44-
"with": {
45-
"github-token": "${{ secrets.GITHUB_TOKEN }}"
46-
}
47-
}
48-
]
49-
}
50-
}
2+
"name": "Node CI",
3+
"on": ["push", "pull_request"],
4+
"jobs": {
5+
"build": {
6+
"runs-on": "ubuntu-latest",
7+
"steps": [{
8+
"uses": 'actions/checkout@v3',
9+
}, {
10+
"name": "Use Node.js ${{ matrix.node-version }}",
11+
"uses": "actions/setup-node@v1",
12+
"with": {
13+
"node-version": "${{ matrix.node-version }}",
14+
},
15+
}, {
16+
"name": "Install Redrun",
17+
"run": "npm i redrun -g",
18+
}, {
19+
"name": "Install",
20+
"run": "npm install",
21+
}, {
22+
"name": "Bootstrap",
23+
"run": "redrun bootstrap",
24+
}, {
25+
"name": "Lint",
26+
"run": "redrun lint",
27+
}, {
28+
"name": "Coverage",
29+
"run": "redrun coverage report",
30+
}, {
31+
"name": "Coveralls",
32+
"uses": "coverallsapp/github-action@master",
33+
"with": {
34+
"github-token": "${{ secrets.GITHUB_TOKEN }}",
35+
},
36+
}],
37+
},
38+
},
5139
});

packages/plugin-github/lib/set-checkout-version/index.js

-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@
33
const {createUsesFixer} = require('../create-uses-fixer');
44

55
module.exports = createUsesFixer('actions/checkout', 'v3');
6-

packages/plugin-github/lib/set-checkout-version/index.spec.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ const {createTest} = require('@putout/test');
44
const setCheckoutVersion = require('.');
55

66
const test = createTest(__dirname, {
7-
'github/set-checkout-version': setCheckoutVersion,
7+
printer: 'putout',
8+
plugins: [
9+
['github/set-checkout-version', setCheckoutVersion],
10+
],
811
});
912

1013
test('plugin-github: set checkout versions: report', (t) => {
@@ -31,4 +34,3 @@ test('plugin-github: set checkout versions: no report: no-uses', (t) => {
3134
t.noReport('no-uses');
3235
t.end();
3336
});
34-
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
__putout_processor_json({
2-
"jobs": {
3-
"build": {
4-
"runs-on": "ubuntu-latest",
5-
"strategy": {
6-
"matrix": {
7-
"node-version": ['16.x', '18.x', '20.x']
8-
}
9-
}
10-
}
11-
}
2+
"jobs": {
3+
"build": {
4+
"runs-on": "ubuntu-latest",
5+
"strategy": {
6+
"matrix": {
7+
"node-version": [
8+
'16.x',
9+
'18.x',
10+
'20.x',
11+
],
12+
},
13+
},
14+
},
15+
},
1216
});
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,39 @@
11
__putout_processor_json({
2-
"name": "Node CI",
3-
"on": [
4-
"push",
5-
"pull_request"
6-
],
7-
"jobs": {
8-
"build": {
9-
"runs-on": "ubuntu-latest",
10-
"steps": [
11-
{
12-
"uses": "actions/checkout@v1"
13-
},
14-
{
15-
"name": "Use Node.js ${{ matrix.node-version }}",
16-
"uses": "actions/setup-node@v1",
17-
"with": {
18-
"node-version": "${{ matrix.node-version }}"
19-
}
20-
},
21-
{
22-
"name": "Install Redrun",
23-
"run": "npm i redrun -g"
24-
},
25-
{
26-
"name": "Install",
27-
"run": "npm install"
28-
},
29-
{
30-
"name": "Bootstrap",
31-
"run": "redrun bootstrap"
32-
},
33-
{
34-
"name": "Lint",
35-
"run": "redrun lint"
36-
},
37-
{
38-
"name": "Coverage",
39-
"run": "redrun coverage report"
40-
},
41-
{
42-
"name": "Coveralls",
43-
"uses": "coverallsapp/github-action@master",
44-
"with": {
45-
"github-token": "${{ secrets.GITHUB_TOKEN }}"
46-
}
47-
}
48-
]
49-
}
50-
}
2+
"name": "Node CI",
3+
"on": ["push", "pull_request"],
4+
"jobs": {
5+
"build": {
6+
"runs-on": "ubuntu-latest",
7+
"steps": [{
8+
"uses": "actions/checkout@v1",
9+
}, {
10+
"name": "Use Node.js ${{ matrix.node-version }}",
11+
"uses": "actions/setup-node@v1",
12+
"with": {
13+
"node-version": "${{ matrix.node-version }}",
14+
},
15+
}, {
16+
"name": "Install Redrun",
17+
"run": "npm i redrun -g",
18+
}, {
19+
"name": "Install",
20+
"run": "npm install",
21+
}, {
22+
"name": "Bootstrap",
23+
"run": "redrun bootstrap",
24+
}, {
25+
"name": "Lint",
26+
"run": "redrun lint",
27+
}, {
28+
"name": "Coverage",
29+
"run": "redrun coverage report",
30+
}, {
31+
"name": "Coveralls",
32+
"uses": "coverallsapp/github-action@master",
33+
"with": {
34+
"github-token": "${{ secrets.GITHUB_TOKEN }}",
35+
},
36+
}],
37+
},
38+
},
5139
});
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
__putout_processor_json({
2-
"jobs": {
3-
"build": {
4-
"runs-on": "ubuntu-latest",
5-
"strategy": {
6-
"matrix": {
7-
"node-version": ['18.x', '22.x']
8-
}
9-
}
10-
}
11-
}
2+
"jobs": {
3+
"build": {
4+
"runs-on": "ubuntu-latest",
5+
"strategy": {
6+
"matrix": {
7+
"node-version": [
8+
'18.x',
9+
'22.x',
10+
],
11+
},
12+
},
13+
},
14+
},
1215
});

0 commit comments

Comments
 (0)