Skip to content

Commit 3ba41c0

Browse files
committed
Merge remote-tracking branch 'origin' into gyb
2 parents 9f8db0d + 35fc264 commit 3ba41c0

File tree

300 files changed

+15156
-4366
lines changed

Some content is hidden

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

300 files changed

+15156
-4366
lines changed

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,12 @@ updates:
1919
- dependency-name: "@vscode/vsce"
2020
update-types: ["version-update:semver-major"]
2121
- dependency-name: "@types/vscode"
22+
- dependency-name: "@types/svgicons2svgfont"
2223
- dependency-name: "octokit"
2324
update-types: ["version-update:semver-major"]
25+
# Newer versions of fantasticon are broken on Windows.
26+
# https://github.com/tancredi/fantasticon/issues/470
27+
- dependency-name: "fantasticon"
2428
groups:
2529
all-dependencies:
2630
patterns:

.github/workflows/nightly.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,9 @@ jobs:
6666
windows_env_vars: |
6767
CI=1
6868
VSCODE_SWIFT_VSIX_ID=${{needs.package.outputs.artifact-id}}
69-
VSCODE_SWIFT_VSIX=vscode-swift.vsix
7069
GITHUB_REPOSITORY=${{github.repository}}
71-
windows_pre_build_command: .github\workflows\scripts\windows\setup.ps1
72-
windows_build_command: scripts\test_windows.ps1
70+
windows_pre_build_command: . .github\workflows\scripts\windows\setup.ps1
71+
windows_build_command: Invoke-Program scripts\test_windows.ps1
7372
enable_windows_docker: false
7473

7574
tests_insiders:
@@ -79,25 +78,26 @@ jobs:
7978
with:
8079
needs_token: true
8180
# Linux
82-
linux_exclude_swift_versions: '[{"swift_version": "5.8"}, {"swift_version": "5.9"}, {"swift_version": "5.10"}, {"swift_version": "6.0"}, {"swift_version": "nightly-6.1"}, {"swift_version": "nightly-6.2"}, {"swift_version": "nightly-main"}]'
81+
linux_exclude_swift_versions: '[{"swift_version": "5.8"}, {"swift_version": "5.9"}, {"swift_version": "5.10"}, {"swift_version": "6.0"}, {"swift_version": "6.1"}, {"swift_version": "nightly-6.1"}, {"swift_version": "nightly-6.2"}, {"swift_version": "nightly-main"}]'
8382
linux_env_vars: |
8483
NODE_VERSION=v20.19.0
8584
NODE_PATH=/usr/local/nvm/versions/node/v20.19.0/bin
8685
NVM_DIR=/usr/local/nvm
8786
CI=1
8887
VSCODE_VERSION=insiders
8988
VSCODE_SWIFT_VSIX_ID=${{needs.package.outputs.artifact-id}}
89+
VSCODE_SWIFT_VSIX_PRERELEASE=1
9090
GITHUB_REPOSITORY=${{github.repository}}
9191
linux_pre_build_command: . .github/workflows/scripts/setup-linux.sh
9292
linux_build_command: ./scripts/test.sh
9393
# Windows
94-
windows_exclude_swift_versions: '[{"swift_version": "5.9"}, {"swift_version": "6.0"}, {"swift_version": "nightly-6.1"}, {"swift_version": "nightly-6.2"}, {"swift_version": "nightly"}]'
94+
windows_exclude_swift_versions: '[{"swift_version": "5.9"}, {"swift_version": "6.0"}, {"swift_version": "6.1"}, {"swift_version": "nightly-6.1"}, {"swift_version": "nightly-6.2"}, {"swift_version": "nightly"}]'
9595
windows_env_vars: |
9696
CI=1
9797
VSCODE_VERSION=insiders
9898
VSCODE_SWIFT_VSIX_ID=${{needs.package.outputs.artifact-id}}
99-
VSCODE_SWIFT_VSIX=vscode-swift.vsix
99+
VSCODE_SWIFT_VSIX_PRERELEASE=1
100100
GITHUB_REPOSITORY=${{github.repository}}
101-
windows_pre_build_command: .github\workflows\scripts\windows\setup.ps1
102-
windows_build_command: scripts\test_windows.ps1
101+
windows_pre_build_command: . .github\workflows\scripts\windows\setup.ps1
102+
windows_build_command: Invoke-Program scripts\test_windows.ps1
103103
enable_windows_docker: false

.github/workflows/pull_request.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ jobs:
2323
. .github/workflows/scripts/setup-linux.sh
2424
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
2525
npm ci
26-
npm run package
27-
npm run preview-package
26+
npm run dev-package
2827
for file in *.vsix; do
2928
name="$(basename "$file" .vsix)-${{github.run_number}}.vsix"
3029
echo "Created bundle $name"
@@ -45,25 +44,31 @@ jobs:
4544
4645
tests:
4746
name: ${{ contains(github.event.pull_request.labels.*.name, 'full-test-run') && 'Full Test Run' || 'Test'}}
47+
needs: package
4848
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
4949
with:
50+
needs_token: true
5051
# Linux
51-
linux_exclude_swift_versions: '[{"swift_version": "nightly-6.1"},{"swift_version": "nightly-6.2"},{"swift_version": "nightly-main"}]'
52+
linux_exclude_swift_versions: "${{ contains(github.event.pull_request.labels.*.name, 'full-test-run') && '[{\"swift_version\": \"nightly-6.1\"}]' || '[{\"swift_version\": \"nightly-6.1\"},{\"swift_version\": \"nightly-6.2\"},{\"swift_version\": \"nightly-main\"}]' }}"
5253
linux_env_vars: |
5354
NODE_VERSION=v20.19.0
5455
NODE_PATH=/usr/local/nvm/versions/node/v20.19.0/bin
5556
NVM_DIR=/usr/local/nvm
5657
CI=1
5758
FAST_TEST_RUN=${{ contains(github.event.pull_request.labels.*.name, 'full-test-run') && '0' || '1'}}
59+
VSCODE_SWIFT_VSIX_ID=${{needs.package.outputs.artifact-id}}
60+
GITHUB_REPOSITORY=${{github.repository}}
5861
linux_pre_build_command: . .github/workflows/scripts/setup-linux.sh
5962
linux_build_command: ./scripts/test.sh
6063
# Windows
61-
windows_exclude_swift_versions: '[{"swift_version": "nightly-6.1"},{"swift_version": "nightly-6.2"},{"swift_version": "nightly"}]'
64+
windows_exclude_swift_versions: "${{ contains(github.event.pull_request.labels.*.name, 'full-test-run') && '[{\"swift_version\": \"nightly-6.1\"},{\"swift_version\": \"nightly\"}]' || '[{\"swift_version\": \"nightly-6.1\"},{\"swift_version\": \"nightly-6.2\"},{\"swift_version\": \"nightly\"}]' }}"
6265
windows_env_vars: |
6366
CI=1
6467
FAST_TEST_RUN=${{ contains(github.event.pull_request.labels.*.name, 'full-test-run') && '0' || '1'}}
65-
windows_pre_build_command: .github\workflows\scripts\windows\setup.ps1
66-
windows_build_command: scripts\test_windows.ps1
68+
VSCODE_SWIFT_VSIX_ID=${{needs.package.outputs.artifact-id}}
69+
GITHUB_REPOSITORY=${{github.repository}}
70+
windows_pre_build_command: . .github\workflows\scripts\windows\setup.ps1
71+
windows_build_command: Invoke-Program scripts\test_windows.ps1
6772
enable_windows_docker: false
6873

6974
soundness:

.github/workflows/scripts/setup-linux.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,4 @@ env | sort
2929
if [ -n "$VSCODE_SWIFT_VSIX_ID" ]; then
3030
npm ci --ignore-scripts
3131
npx tsx scripts/download_vsix.ts
32-
export VSCODE_SWIFT_VSIX="vscode-swift.vsix"
3332
fi

.github/workflows/scripts/windows/setup.ps1

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,16 @@
22
. .github\workflows\scripts\windows\install-nodejs.ps1
33

44
# Download the VSIX archived upstream
5-
npm ci -ignore-script node-pty
5+
npm ci
66
$Process = Start-Process npx "tsx scripts/download_vsix.ts" -Wait -PassThru -NoNewWindow
77
if ($Process.ExitCode -eq 0) {
88
Write-Host 'SUCCESS'
99
} else {
1010
Write-Host ('FAILED ({0})' -f $Process.ExitCode)
1111
exit 1
1212
}
13+
14+
Get-Content $env:GITHUB_ENV | foreach {
15+
$name, $value = $_.split('=')
16+
Set-Content env:\$name $value
17+
}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ coverage
66
test-results
77
userdocs/userdocs.docc/.docc-build
88

9+
# SwiftPM cache for tests
10+
.spm-cache
11+
912
# Generated Assets
1013
assets/documentation-webview
1114
assets/icons

.husky/pre-commit

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Store list of staged files before formatting
2+
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACMR)
3+
4+
# Run lint-staged to format only staged files
5+
echo "Running formatter on staged files..."
6+
npx lint-staged
7+
8+
# Check if there are any changes in previously staged files
9+
UNSTAGED_CHANGES=0
10+
for FILE in $STAGED_FILES; do
11+
if [ -f "$FILE" ] && git diff --quiet "$FILE"; then
12+
# No changes in this file
13+
continue
14+
else
15+
# Changes detected
16+
UNSTAGED_CHANGES=1
17+
echo "File modified after formatting: $FILE"
18+
fi
19+
done
20+
21+
if [ $UNSTAGED_CHANGES -eq 1 ]; then
22+
echo "Error: There are unstaged changes after running the formatter."
23+
echo "Please stage the modified files and try committing again."
24+
exit 1
25+
fi

.mocha-reporter.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,22 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
const BaseReporter = require("mocha/lib/reporters/base");
16-
const SpecReporter = require("mocha/lib/reporters/spec");
17-
const JsonReporter = require("mocha/lib/reporters/json");
15+
const mocha = require("mocha");
16+
const GHASummaryReporter = require("./dist/test/reporters/GitHubActionsSummaryReporter");
1817

1918
// Taking inspiration from https://github.com/stanleyhlng/mocha-multi-reporters/issues/108#issuecomment-2028773686
2019
// since mocha-multi-reporters seems to have bugs with newer mocha versions
21-
module.exports = class MultiReporter extends BaseReporter {
20+
module.exports = class MultiReporter extends mocha.reporters.Base {
2221
constructor(runner, options) {
2322
super(runner, options);
2423
this.reporters = [
25-
new SpecReporter(runner, {
24+
new mocha.reporters.Spec(runner, {
2625
reporterOption: options.reporterOption.specReporterOptions,
2726
}),
28-
new JsonReporter(runner, {
27+
new GHASummaryReporter(runner, {
28+
reporterOption: options.reporterOption.githubActionsSummaryReporterOptions,
29+
}),
30+
new mocha.reporters.JSON(runner, {
2931
reporterOption: options.reporterOption.jsonReporterOptions,
3032
}),
3133
];

.prettierrc.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
{
2+
"plugins": ["@trivago/prettier-plugin-sort-imports"],
3+
"endOfLine": "auto",
24
"trailingComma": "es5",
35
"printWidth": 100,
46
"tabWidth": 4,
57
"arrowParens": "avoid",
8+
"importOrder": ["^@src/(.*)$", "^\\.(\\.)?/(.*)$"],
9+
"importOrderSeparation": true,
10+
"importOrderSortSpecifiers": true,
11+
"importOrderSideEffects": false,
612
"overrides": [
713
{
814
"files": "*.json",

.unacceptablelanguageignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
assets/swift-docc-render
2+
src/typings/node-pty.d.ts
23
src/utilities/utilities.ts
34
src/tasks/SwiftProcess.ts
45
syntaxes/swift-gyb.tmLanguage.json

0 commit comments

Comments
 (0)