Skip to content

Commit 628301b

Browse files
Test restructuring and cleanup (#11262)
* updated files * queue and ready are now separate * checkpoint * found it! fixed missing call * cleaned up and refactored a bit * cleanup * whoops. make sure linter runs! * Make the queue itself static * addressed formatting issues, added more rules to eslint * more formatting, made ready Promise/void * checkpoint * checkpoint * checkpoint * checkpoint (linting) * checkpoint * checkpoint * checkpoint * checkpoint * renamed path to filepath. * checkpoint * checkpoint * so close... * checkpoint again * before making doc * checkpoint * checkpoint * Checkpoint * renamed awaiters * eslint * fix format on generated native strings * add dummy pretest task back in for the moment * change unit test runing * posix calc test failure * make signal dispose better * add est regen script * missed file * checkpoint * Improve scripts a bit * remove hooks for now * remove unused script * remove unused script * filter out files * ensure that eslint works for scripts too * fix build oses to specific version * cleanups and tweaking * adjusted for cosmetic feedback * more * add eslint rule to fix space before/after semicolon * remove tba/tbd * cleanup * Added space-infix-ops rule * cleanup * resolve comments * resolve comments * add simple debug task * spelling fixes * cleanup more * More changes. yay * remove the extra whitespace from before comments * add eslint rule to ensure that there are never extra spaces * adding another eslint rule to ensure that there isn't spacing around unary operators, which we all know is dangerous. Or weird. I forget which * added a space between vs and code because a space is the desired format * removed all mentions of transpiler which was removed * removed an extra comma * removed a trailing slash * removed useless lines * missed as file * reconfigure no-extra-parens rule * added note about yarn install * whatever * more fun * FIx it so that it webpacks correctly * remove refernces to attic * restore line to correct check * fix whitespace * added blank yarn install * removed
1 parent 6efaafe commit 628301b

File tree

245 files changed

+13461
-2486
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

245 files changed

+13461
-2486
lines changed

.github/workflows/ci_linux.yml

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
1-
name: CI (Linux)
2-
3-
on:
4-
push:
5-
branches: [ main ]
6-
pull_request:
7-
branches: [ main ]
8-
9-
jobs:
10-
build:
11-
runs-on: ubuntu-latest
12-
13-
steps:
14-
- uses: actions/checkout@v3
15-
16-
- name: Use Node.js 16
17-
uses: actions/setup-node@v3
18-
with:
19-
node-version: 16
20-
21-
- name: Install Dependencies
22-
run: yarn install
23-
working-directory: Extension
24-
25-
- name: Compile Sources
26-
run: yarn run compile
27-
working-directory: Extension
28-
29-
- name: Run Linter
30-
run: yarn run lint
31-
working-directory: Extension
32-
33-
- name: Compile Test Sources
34-
run: yarn run pretest
35-
working-directory: Extension
36-
37-
- name: Run unit tests
38-
uses: GabrielBB/[email protected]
39-
with:
40-
run: yarn run unitTests
41-
working-directory: Extension
42-
43-
# - name: Run languageServer integration tests
44-
# uses: GabrielBB/[email protected]
45-
# with:
46-
# run: yarn run integrationTests
47-
# working-directory: Extension
1+
name: CI (Linux)
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-22.04
12+
13+
steps:
14+
- uses: actions/checkout@v3
15+
16+
- name: Use Node.js 16
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version: 16
20+
21+
- name: Install Dependencies
22+
run: yarn install
23+
working-directory: Extension
24+
25+
- name: Compile Sources
26+
run: yarn run compile
27+
working-directory: Extension
28+
29+
- name: Run Linter
30+
run: yarn run lint
31+
working-directory: Extension
32+
33+
- name: Run unit tests
34+
run: yarn test
35+
working-directory: Extension
36+
37+
- name: Run simple vscode unit tests
38+
uses: GabrielBB/[email protected]
39+
with:
40+
run: yarn test --scenario=SingleRootProject
41+
working-directory: Extension
42+
43+
# - name: Run languageServer integration tests
44+
# uses: GabrielBB/[email protected]
45+
# with:
46+
# run: yarn run integrationTests
47+
# working-directory: Extension

.github/workflows/ci_mac.yml

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
1-
name: CI (Mac)
2-
3-
on:
4-
push:
5-
branches: [ main ]
6-
pull_request:
7-
branches: [ main ]
8-
9-
jobs:
10-
build:
11-
runs-on: macos-latest
12-
13-
steps:
14-
- uses: actions/checkout@v3
15-
16-
- name: Use Node.js 16
17-
uses: actions/setup-node@v3
18-
with:
19-
node-version: 16
20-
21-
- name: Install Dependencies
22-
run: yarn install --network-timeout 100000
23-
working-directory: Extension
24-
25-
- name: Compile Sources
26-
run: yarn run compile
27-
working-directory: Extension
28-
29-
- name: Run Linter
30-
run: yarn run lint
31-
working-directory: Extension
32-
33-
- name: Compile Test Sources
34-
run: yarn run pretest
35-
working-directory: Extension
36-
37-
- name: Run unit tests
38-
uses: GabrielBB/[email protected]
39-
with:
40-
run: yarn run unitTests
41-
working-directory: Extension
42-
43-
# - name: Run languageServer integration tests
44-
# uses: GabrielBB/[email protected]
45-
# with:
46-
# run: yarn run integrationTests
47-
# working-directory: Extension
1+
name: CI (Mac)
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
runs-on: macos-12
12+
13+
steps:
14+
- uses: actions/checkout@v3
15+
16+
- name: Use Node.js 16
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version: 16
20+
21+
- name: Install Dependencies
22+
run: yarn install --network-timeout 100000
23+
working-directory: Extension
24+
25+
- name: Compile Sources
26+
run: yarn run compile
27+
working-directory: Extension
28+
29+
- name: Run Linter
30+
run: yarn run lint
31+
working-directory: Extension
32+
33+
- name: Run unit tests
34+
run: yarn test
35+
working-directory: Extension
36+
37+
- name: Run simple vscode unit tests
38+
uses: GabrielBB/[email protected]
39+
with:
40+
run: yarn test --scenario=SingleRootProject
41+
working-directory: Extension
42+
43+
# - name: Run languageServer integration tests
44+
# uses: GabrielBB/[email protected]
45+
# with:
46+
# run: yarn run integrationTests
47+
# working-directory: Extension

.github/workflows/ci_windows.yml

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
1-
name: CI (Windows)
2-
3-
on:
4-
push:
5-
branches: [ main ]
6-
pull_request:
7-
branches: [ main ]
8-
9-
jobs:
10-
build:
11-
runs-on: windows-latest
12-
13-
steps:
14-
- uses: actions/checkout@v3
15-
16-
- name: Use Node.js 16
17-
uses: actions/setup-node@v3
18-
with:
19-
node-version: 16
20-
21-
- name: Install Dependencies
22-
run: yarn install
23-
working-directory: Extension
24-
25-
- name: Compile Sources
26-
run: yarn run compile
27-
working-directory: Extension
28-
29-
- name: Run Linter
30-
run: yarn run lint
31-
working-directory: Extension
32-
33-
- name: Compile Test Sources
34-
run: yarn run pretest
35-
working-directory: Extension
36-
37-
- name: Run unit tests
38-
run: yarn run unitTests
39-
working-directory: Extension
40-
41-
# - name: Run languageServer integration tests
42-
# run: yarn run integrationTests
43-
# working-directory: Extension
1+
name: CI (Windows)
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
runs-on: windows-2022
12+
13+
steps:
14+
- uses: actions/checkout@v3
15+
16+
- name: Use Node.js 16
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version: 16
20+
21+
- name: Install Dependencies
22+
run: yarn install
23+
working-directory: Extension
24+
25+
- name: Compile Sources
26+
run: yarn run compile
27+
working-directory: Extension
28+
29+
- name: Run Linter
30+
run: yarn run lint
31+
working-directory: Extension
32+
33+
- name: Run unit tests
34+
run: yarn test
35+
working-directory: Extension
36+
37+
- name: Run simple vscode unit tests
38+
run: yarn test --scenario=SingleRootProject
39+
working-directory: Extension
40+
41+
# - name: Run languageServer integration tests
42+
# run: yarn run integrationTests
43+
# working-directory: Extension

Extension/.eslintignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
*.js
2-
test/**/index.ts
3-
test/**/runTest.ts
4-
tools/prepublish.js
2+
3+
dist/
54
vscode*.d.ts

Extension/.eslintrc.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module.exports = {
1111
},
1212
"parser": "@typescript-eslint/parser",
1313
"parserOptions": {
14-
"project": "tsconfig.json",
14+
"project": ["tsconfig.json", ".scripts/tsconfig.json"],
1515
"ecmaVersion": 2022,
1616
"sourceType": "module",
1717
"warnOnUnsupportedTypeScriptVersion": false,
@@ -64,6 +64,8 @@ module.exports = {
6464
"no-floating-decimal": "error",
6565
"keyword-spacing": ["error", { "before": true, "overrides": { "this": { "before": false } } }],
6666
"arrow-spacing": ["error", { "before": true, "after": true }],
67+
"semi-spacing": ["error", { "before": false, "after": true }],
68+
"no-extra-parens": ["error", "all", { "nestedBinaryExpressions": false, "ternaryOperandBinaryExpressions": false }],
6769
"@typescript-eslint/no-for-in-array": "error",
6870
"@typescript-eslint/no-misused-new": "error",
6971
"@typescript-eslint/no-misused-promises": "error",
@@ -82,6 +84,7 @@ module.exports = {
8284
"@typescript-eslint/unified-signatures": "error",
8385
"@typescript-eslint/no-floating-promises": "error",
8486
"@typescript-eslint/method-signature-style": ["error", "method"],
87+
"@typescript-eslint/space-infix-ops": "error",
8588
"no-unused-vars": "off",
8689
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
8790
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "error",
@@ -110,12 +113,14 @@ module.exports = {
110113
"no-fallthrough": "error",
111114
"no-invalid-this": "error",
112115
"no-irregular-whitespace": "error",
116+
"rest-spread-spacing": ["error", "never"],
113117
"no-multiple-empty-lines": ["error", { "max": 1, "maxEOF": 1, "maxBOF": 0 }],
114118
"no-new-wrappers": "error",
115119
"no-return-await": "error",
116120
"no-sequences": "error",
117121
"no-sparse-arrays": "error",
118122
"no-trailing-spaces": "error",
123+
"no-multi-spaces": "error",
119124
"no-undef-init": "error",
120125
"no-unsafe-finally": "error",
121126
"no-unused-expressions": "error",

Extension/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,4 @@ localized_string_ids.h
3434
src/nativeStrings.ts
3535

3636
vscode*.d.ts
37+
.scripts/_*

Extension/.scripts/clean.ts

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/* --------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All Rights Reserved.
3+
* See 'LICENSE' in the project root for license information.
4+
* ------------------------------------------------------------------------------------------ */
5+
6+
import { error } from 'node:console';
7+
import { resolve, sep } from 'node:path';
8+
import { filepath } from '../src/Utility/Filesystem/filepath';
9+
import { verbose } from '../src/Utility/Text/streams';
10+
import { $root, Git, brightGreen, cyan, getModifiedIgnoredFiles, rimraf } from './common';
11+
12+
// notes:
13+
// list all gitignore'd files that are modified: `git clean -Xd -n`
14+
// list all untracked and ignored files that are modified/created: `git clean -Xd -n`
15+
16+
export async function main() {
17+
await rimraf(resolve($root, 'dist'));
18+
}
19+
20+
export async function all() {
21+
await rimraf(...(await getModifiedIgnoredFiles()).filter(each => !each.includes('node_modules')));
22+
}
23+
24+
export async function reset() {
25+
verbose(`Resetting all .gitignored files in extension`);
26+
await rimraf(...await getModifiedIgnoredFiles());
27+
}
28+
29+
async function details(files: string[]) {
30+
let all = await Promise.all(files.filter(each => each).map(async (each) => {
31+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
32+
const [filename, stats ] = await filepath.stats(each);
33+
return {
34+
filename: stats.isDirectory() ? cyan(`${each}${sep}**`) : brightGreen(`${each}`),
35+
date: stats.mtime.toLocaleDateString().replace(/\b(\d)\//g, '0$1\/'),
36+
time: stats.mtime.toLocaleTimeString().replace(/^(\d)\:/g, '0$1:'),
37+
modified: stats.mtime
38+
};
39+
}));
40+
all = all.sort((a, b) => a.modified.getTime() - b.modified.getTime());
41+
// print a formatted table so the date and time are aligned
42+
const max = all.reduce((max, each) => Math.max(max, each.filename.length), 0);
43+
all.forEach(each => console.log(` ${each.filename.padEnd(max)} [${each.date} ${each.time}]`));
44+
console.log('');
45+
}
46+
47+
export async function show(opt?: string) {
48+
switch (opt?.toLowerCase()) {
49+
case 'new':
50+
console.log(cyan('\n\nNew files:'));
51+
const r = await Git('ls-files', '--others', '--exclude-standard', '-z');
52+
return details(r.stdio.all().map(each => resolve(each.trim().replace(/\0/g, ''))));
53+
54+
case undefined:
55+
case '':
56+
case 'ignored':
57+
case 'untracked':
58+
console.log(cyan('\n\nUntracked+Ignored files:'));
59+
return details(await getModifiedIgnoredFiles());
60+
61+
default:
62+
return error(`Unknown option '${opt}'`);
63+
}
64+
}

0 commit comments

Comments
 (0)