From 4f4da65245ee71050cebd6fc0c782dcdbfc3b214 Mon Sep 17 00:00:00 2001 From: Vlad Date: Wed, 26 Aug 2020 21:23:27 +0300 Subject: [PATCH 01/12] ci: prettier --- .github/workflows/format.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/format.yml diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 0000000..3ace587 --- /dev/null +++ b/.github/workflows/format.yml @@ -0,0 +1,35 @@ +name: Prettier - code formatting +on: + push: + branches: [master, format] + pull_request: + branches: [master, format] +jobs: + format: + runs-on: ubuntu-latest + steps: + - name: Get npm cache directory + id: npm-cache + run: | + echo "::set-output name=dir::$(npm config get cache)" + - uses: actions/cache@v2 + with: + path: ${{ steps.npm-cache.outputs.dir }} + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + - uses: actions/checkout@v2 + with: + ref: ${{ github.head_ref }} + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: npm ci + - name: Format + run: npm run format + - name: Commit changes + uses: stefanzweifel/git-auto-commit-action@v4.1.2 + with: + commit_message: Apply formatting changes + branch: ${{ github.head_ref }} From 3caaba7005f3eeb433056cadb1b5de4abebd0305 Mon Sep 17 00:00:00 2001 From: Vlad Date: Wed, 26 Aug 2020 21:24:00 +0300 Subject: [PATCH 02/12] ci: format tests --- .github/workflows/format.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 3ace587..bad0176 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -1,7 +1,7 @@ name: Prettier - code formatting on: push: - branches: [master, format] + branches: [master, format, format-tests] pull_request: branches: [master, format] jobs: From 25de82de83d2e286d7472f04b794fa6779571056 Mon Sep 17 00:00:00 2001 From: Vlad Date: Wed, 26 Aug 2020 21:24:19 +0300 Subject: [PATCH 03/12] chore: prettier --- package.json | 5 ----- 1 file changed, 5 deletions(-) diff --git a/package.json b/package.json index 02e36e6..9dde155 100644 --- a/package.json +++ b/package.json @@ -45,10 +45,5 @@ "jest": "^26.0.1", "prettier": "^2.0.5", "pretty-quick": "^3.0.0" - }, - "husky": { - "hooks": { - "pre-commit": "pretty-quick --staged" - } } } From 6853ccabc55bc04988f3613297153289e95043b2 Mon Sep 17 00:00:00 2001 From: Vlad Date: Wed, 26 Aug 2020 21:24:44 +0300 Subject: [PATCH 04/12] test commit --- lib/cli.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/cli.js b/lib/cli.js index 17ecd83..204eba2 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -20,6 +20,7 @@ module.exports = async (argvs) => { const argv = yargs_parser(argvs, { alias: { release: ["r"], yes: ["y"] }, }); + let tests={example:"vlad"}; const timer = elapsed.start(); const version = (argv["release"] || "latest").toString(); const targetDir = path.resolve(argv["_"][0] || "./"); From 37c9c714a58bab4dac54069f7fad2e9d7594b55a Mon Sep 17 00:00:00 2001 From: Vlad Date: Wed, 26 Aug 2020 21:25:57 +0300 Subject: [PATCH 05/12] test --- .github/workflows/format.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index bad0176..20f89ab 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -1,4 +1,4 @@ -name: Prettier - code formatting +name: Prettier code formatting on: push: branches: [master, format, format-tests] From c38e4bcb03de78783f839aeedce9d99ed3bd91f5 Mon Sep 17 00:00:00 2001 From: Vlad Date: Wed, 26 Aug 2020 21:27:24 +0300 Subject: [PATCH 06/12] test commit --- lib/cli.js | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cli.js b/lib/cli.js index 204eba2..5048df1 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -20,7 +20,7 @@ module.exports = async (argvs) => { const argv = yargs_parser(argvs, { alias: { release: ["r"], yes: ["y"] }, }); - let tests={example:"vlad"}; + let tests = { example: "vlad" }; const timer = elapsed.start(); const version = (argv["release"] || "latest").toString(); const targetDir = path.resolve(argv["_"][0] || "./"); diff --git a/package.json b/package.json index 9dde155..1118948 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ }, "scripts": { "test": "jest", - "format": "prettier --write \"./cli.js\" \"tests/*.js\"", + "format": "prettier --write \"./lib/cli.js\" \"tests/*.js\"", "coverage": "jest --coverage --collectCoverageOnlyFrom ./lib/cli.js" }, "files": [ From 064aecf1a4d756e8fbdae87c7e0533c0b056a9e3 Mon Sep 17 00:00:00 2001 From: Vlad Date: Wed, 26 Aug 2020 21:28:41 +0300 Subject: [PATCH 07/12] test commit #2 --- lib/cli.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cli.js b/lib/cli.js index 5048df1..663c7eb 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -20,7 +20,7 @@ module.exports = async (argvs) => { const argv = yargs_parser(argvs, { alias: { release: ["r"], yes: ["y"] }, }); - let tests = { example: "vlad" }; + let tests = {example:"vlad"}; const timer = elapsed.start(); const version = (argv["release"] || "latest").toString(); const targetDir = path.resolve(argv["_"][0] || "./"); From ce32ba1b6a673dc2e89609d9ed84fc3f1a841629 Mon Sep 17 00:00:00 2001 From: vltansky Date: Wed, 26 Aug 2020 18:29:11 +0000 Subject: [PATCH 08/12] Apply formatting changes --- lib/cli.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cli.js b/lib/cli.js index 663c7eb..5048df1 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -20,7 +20,7 @@ module.exports = async (argvs) => { const argv = yargs_parser(argvs, { alias: { release: ["r"], yes: ["y"] }, }); - let tests = {example:"vlad"}; + let tests = { example: "vlad" }; const timer = elapsed.start(); const version = (argv["release"] || "latest").toString(); const targetDir = path.resolve(argv["_"][0] || "./"); From e4015182c0947e19fad6fbd4d2282fc6031af10d Mon Sep 17 00:00:00 2001 From: Vlad Date: Wed, 26 Aug 2020 21:30:00 +0300 Subject: [PATCH 09/12] ci: format --- .github/workflows/format.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 20f89ab..fcd0763 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -1,7 +1,7 @@ name: Prettier code formatting on: push: - branches: [master, format, format-tests] + branches: [master, format] pull_request: branches: [master, format] jobs: From 195c9c5953fd980c9d4052f1acdef254b7460545 Mon Sep 17 00:00:00 2001 From: Vlad Date: Wed, 26 Aug 2020 21:57:24 +0300 Subject: [PATCH 10/12] try pretty-quick --- .github/workflows/format.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index fcd0763..336ebd9 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -1,7 +1,7 @@ name: Prettier code formatting on: push: - branches: [master, format] + branches: [master, format, format-tests] pull_request: branches: [master, format] jobs: @@ -27,7 +27,7 @@ jobs: node-version: ${{ matrix.node-version }} - run: npm ci - name: Format - run: npm run format + run: pretty-quick --staged - name: Commit changes uses: stefanzweifel/git-auto-commit-action@v4.1.2 with: From 421ff124b180c14ee9b2322208c7db014ab71781 Mon Sep 17 00:00:00 2001 From: Vlad Date: Wed, 26 Aug 2020 21:58:09 +0300 Subject: [PATCH 11/12] test --- tests/test.js | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test.js b/tests/test.js index 22ee447..7c06b2c 100644 --- a/tests/test.js +++ b/tests/test.js @@ -48,6 +48,7 @@ const runCli = async ({ await fs.ensureDir(defaultDir); prevCwd = process.cwd(); process.chdir(defaultDir); + let test={vlad:"test"}; } if (version) { From b71ccd2cffa3d35dc0bb9bf990b6fad3bdff9f9a Mon Sep 17 00:00:00 2001 From: Vlad Date: Wed, 26 Aug 2020 22:03:23 +0300 Subject: [PATCH 12/12] ci: format --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1118948..9dde155 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ }, "scripts": { "test": "jest", - "format": "prettier --write \"./lib/cli.js\" \"tests/*.js\"", + "format": "prettier --write \"./cli.js\" \"tests/*.js\"", "coverage": "jest --coverage --collectCoverageOnlyFrom ./lib/cli.js" }, "files": [