Skip to content

Commit 6a97fc6

Browse files
editor/code: Break down CI steps to know what is failing easily
To do this change, we reorganize npm-script. | previous | after | |--------------------|----------------------------------------| | `npm run lint` | `npm run lint && npm run format:check` | | `npm run fix` | `npm run lint:fix && npm run format` | The previous `npm run fix` sometimes does not complete fix automatically because ESLint's autofix doees not follow prettier's formatting. So we need to run `npm run lint:fix && npm run format` by this order.
1 parent c7ce8ad commit 6a97fc6

File tree

2 files changed

+27
-7
lines changed

2 files changed

+27
-7
lines changed

.github/workflows/ci.yaml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,28 +161,45 @@ jobs:
161161
# if: runner.os == 'Linux'
162162
# working-directory: ./editors/code
163163

164+
# You may fix the code automatically by running `npm run lint:fix` if this steps fails.
164165
- run: npm run lint
165166
working-directory: ./editors/code
166167
if: needs.changes.outputs.typescript == 'true'
167168

169+
# To fix this steps, please run `npm run format`.
170+
- run: npm run format:check
171+
working-directory: ./editors/code
172+
if: needs.changes.outputs.typescript == 'true'
173+
168174
- name: Run VS Code tests (Linux)
169175
if: matrix.os == 'ubuntu-latest' && needs.changes.outputs.typescript == 'true'
170176
env:
171177
VSCODE_CLI: 1
172178
run: xvfb-run npm test
173179
working-directory: ./editors/code
174180

181+
# To fix this steps, please run `npm run format`.
182+
- run: npm run format:check
183+
working-directory: ./editors/code
184+
if: needs.changes.outputs.typescript == 'true'
185+
186+
# If this steps fails, your code's type integrity might be wrong at some places at TypeScript level.
187+
- run: npm run typecheck
188+
working-directory: ./editors/code
189+
if: needs.changes.outputs.typescript == 'true'
190+
191+
# If this steps fails, your code's type integrity might be wrong at some places at ESLint.
192+
- run: npm run lint
193+
working-directory: ./editors/code
194+
if: needs.changes.outputs.typescript == 'true'
195+
175196
- name: Run VS Code tests (Windows)
176197
if: matrix.os == 'windows-latest' && needs.changes.outputs.typescript == 'true'
177198
env:
178199
VSCODE_CLI: 1
179200
run: npm test
180201
working-directory: ./editors/code
181202

182-
- run: npm run pretest
183-
working-directory: ./editors/code
184-
if: needs.changes.outputs.typescript == 'true'
185-
186203
- run: npm run package --scripts-prepend-node-path
187204
working-directory: ./editors/code
188205
if: needs.changes.outputs.typescript == 'true'

editors/code/package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,12 @@
3535
"build-base": "esbuild ./src/main.ts --bundle --outfile=out/main.js --external:vscode --format=cjs --platform=node --target=node16",
3636
"build": "npm run build-base -- --sourcemap",
3737
"watch": "npm run build-base -- --sourcemap --watch",
38-
"lint": "prettier --check . && eslint -c .eslintrc.js --ext ts ./src ./tests",
39-
"fix": "prettier --write . && eslint -c .eslintrc.js --ext ts ./src ./tests --fix",
40-
"pretest": "tsc && npm run build",
38+
"format": "prettier --write .",
39+
"format:check": "prettier --check .",
40+
"lint": "eslint -c .eslintrc.js --ext ts ./src ./tests",
41+
"lint:fix": "npm run lint -- --fix",
42+
"typecheck": "tsc",
43+
"pretest": "npm run typecheck && npm run build",
4144
"test": "node ./out/tests/runTests.js"
4245
},
4346
"dependencies": {

0 commit comments

Comments
 (0)