diff --git a/docker/test.sh b/docker/test.sh index c1d26d8ca..c017ba53d 100755 --- a/docker/test.sh +++ b/docker/test.sh @@ -18,6 +18,7 @@ npm ci npm run lint npm run format npm run package +npm run test-soundness -- --force-run (xvfb-run -a npm run coverage; echo $? > exitcode) | grep -Ev "Failed to connect to the bus|GPU stall due to ReadPixels" && rm -rf "${current_directory}/coverage" && (cp -R ./coverage "${current_directory}" || true) exit "$( Checking license headers... " +tmp=$(mktemp /tmp/.vscode-swift-soundness_XXXXXX) + +for language in typescript-or-javascript bash; do + declare -a matching_files + matching_files=( -name '*' ) + case "$language" in + typescript-or-javascript) + matching_files=( -name '*.js' -o -name '*.ts' ) + cat > "$tmp" <<"EOF" +//===----------------------------------------------------------------------===// +// +// This source file is part of the VS Code Swift open source project +// +// Copyright (c) YEARS the VS Code Swift project authors +// Licensed under Apache License v2.0 +// +// See LICENSE.txt for license information +// See CONTRIBUTORS.txt for the list of VS Code Swift project authors +// +// SPDX-License-Identifier: Apache-2.0 +// +//===----------------------------------------------------------------------===// +EOF + ;; + bash) + matching_files=( -name '*.sh' ) + cat > "$tmp" <<"EOF" +#!/bin/bash +##===----------------------------------------------------------------------===## +## +## This source file is part of the VS Code Swift open source project +## +## Copyright (c) YEARS the VS Code Swift project authors +## Licensed under Apache License v2.0 +## +## See LICENSE.txt for license information +## See CONTRIBUTORS.txt for the list of VS Code Swift project authors +## +## SPDX-License-Identifier: Apache-2.0 +## +##===----------------------------------------------------------------------===## +EOF + ;; + *) + echo >&2 "ERROR: unknown language '$language'" + ;; + esac + + expected_lines=$(cat "$tmp" | wc -l) + expected_sha=$(cat "$tmp" | shasum) + + ( + cd "$here/.." + { + find . \ + \( \! -path './.build/*' -a \ + \( \! -path './node_modules/*' -a \ + \( \! -path './out/*' -a \ + \( \! -path './.vscode-test/*' -a \ + \( \! -path './docker/*' -a \ + \( \! -path './dist/*' -a \ + \( \! -path './assets/*' -a \ + \( \! -path './coverage/*' -a \ + \( "${matching_files[@]}" \) \ + \) \) \) \) \) \) \) \) + + if [[ "$language" = bash ]]; then + # add everything with a shell shebang too + git grep --full-name -l '#!/bin/bash' + git grep --full-name -l '#!/bin/sh' + fi + } | while read line; do + if [[ "$(cat "$line" | replace_acceptable_years | head -n $expected_lines | shasum)" != "$expected_sha" ]]; then + printf "\033[0;31mmissing headers in file '$line'!\033[0m\n" + diff -u <(cat "$line" | replace_acceptable_years | head -n $expected_lines) "$tmp" + exit 1 + fi + done + printf "\033[0;32mokay.\033[0m\n" + ) +done + +rm "$tmp" + +# printf "=> Checking for broken links in documentation... " +# find . -name node_modules -prune -o -name \*.md -print0 | xargs -0 -n1 npx markdown-link-check +# printf "\033[0;32mokay.\033[0m\n" \ No newline at end of file diff --git a/src/utilities/native.ts b/src/utilities/native.ts index 8245454ce..bfab09f95 100644 --- a/src/utilities/native.ts +++ b/src/utilities/native.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-require-imports */ //===----------------------------------------------------------------------===// // // This source file is part of the VS Code Swift open source project @@ -12,7 +11,7 @@ // SPDX-License-Identifier: Apache-2.0 // //===----------------------------------------------------------------------===// - +/* eslint-disable @typescript-eslint/no-require-imports */ import * as vscode from "vscode"; // To not electron-rebuild for every platform and arch, we want to