forked from microsoft/vscode
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'microsoft:main' into main
- Loading branch information
Showing
331 changed files
with
7,767 additions
and
3,091 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
import { TSESTree } from '@typescript-eslint/typescript-estree'; | ||
import * as eslint from 'eslint'; | ||
import { dirname, join, relative } from 'path'; | ||
import minimatch from 'minimatch'; | ||
import { createImportRuleListener } from './utils'; | ||
|
||
export = new class implements eslint.Rule.RuleModule { | ||
|
||
readonly meta: eslint.Rule.RuleMetaData = { | ||
messages: { | ||
layerbreaker: 'You are only allowed to import {{import}} from here using `import type ...`.' | ||
}, | ||
schema: { | ||
type: "array", | ||
items: { | ||
type: "object", | ||
additionalProperties: { | ||
type: "array", | ||
items: { | ||
type: "string" | ||
} | ||
} | ||
} | ||
} | ||
}; | ||
|
||
create(context: eslint.Rule.RuleContext): eslint.Rule.RuleListener { | ||
let fileRelativePath = relative(dirname(__dirname), context.getFilename()); | ||
if (!fileRelativePath.endsWith('/')) { | ||
fileRelativePath += '/'; | ||
} | ||
const ruleArgs = <Record<string, string[]>>context.options[0]; | ||
|
||
const matchingKey = Object.keys(ruleArgs).find(key => fileRelativePath.startsWith(key) || minimatch(fileRelativePath, key)); | ||
if (!matchingKey) { | ||
// nothing | ||
return {}; | ||
} | ||
|
||
const restrictedImports = ruleArgs[matchingKey]; | ||
return createImportRuleListener((node, path) => { | ||
if (path[0] === '.') { | ||
path = join(dirname(context.getFilename()), path); | ||
} | ||
|
||
if (( | ||
restrictedImports.includes(path) || restrictedImports.some(restriction => minimatch(path, restriction)) | ||
) && !( | ||
(node.parent?.type === TSESTree.AST_NODE_TYPES.ImportDeclaration && node.parent.importKind === 'type') || | ||
(node.parent && 'exportKind' in node.parent && node.parent.exportKind === 'type'))) { // the export could be multiple types | ||
context.report({ | ||
loc: node.parent!.loc, | ||
messageId: 'layerbreaker', | ||
data: { | ||
import: path | ||
} | ||
}); | ||
} | ||
}); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# ensure the API police is aware of changes to the vscode-dts file | ||
# this is only about the final API, not about proposed API changes | ||
src/vscode-dts/vscode.d.ts @jrieken @mjbvz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
disturl "https://electronjs.org/headers" | ||
target "27.2.3" | ||
ms_build_id "26495564" | ||
target "27.3.1" | ||
ms_build_id "26731440" | ||
runtime "electron" | ||
build_from_source "true" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
2024-01-29T19:26:27.993Z | ||
2024-02-05T09:34:15.476Z |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
TRIPLE="x86_64-linux-gnu" | ||
if [ "$VSCODE_ARCH" == "arm64" ]; then | ||
TRIPLE="aarch64-linux-gnu" | ||
elif [ "$VSCODE_ARCH" == "armhf" ]; then | ||
TRIPLE="arm-rpi-linux-gnueabihf" | ||
fi | ||
|
||
# Get all files with .node extension from remote/node_modules folder | ||
files=$(find remote/node_modules -name "*.node" -not -path "*prebuilds*") | ||
|
||
echo "Verifying requirements for files: $files" | ||
|
||
for file in $files; do | ||
glibc_version="$EXPECTED_GLIBC_VERSION" | ||
glibcxx_version="$EXPECTED_GLIBCXX_VERSION" | ||
while IFS= read -r line; do | ||
if [[ $line == *"GLIBC_"* ]]; then | ||
version=$(echo "$line" | awk '{print $5}' | tr -d '()') | ||
version=${version#*_} | ||
if [[ $(printf "%s\n%s" "$version" "$glibc_version" | sort -V | tail -n1) == "$version" ]]; then | ||
glibc_version=$version | ||
fi | ||
elif [[ $line == *"GLIBCXX_"* ]]; then | ||
version=$(echo "$line" | awk '{print $5}' | tr -d '()') | ||
version=${version#*_} | ||
if [[ $(printf "%s\n%s" "$version" "$glibcxx_version" | sort -V | tail -n1) == "$version" ]]; then | ||
glibcxx_version=$version | ||
fi | ||
fi | ||
done < <("$PWD/.build/sysroots/$TRIPLE/$TRIPLE/bin/objdump" -T "$file") | ||
|
||
if [[ "$glibc_version" != "$EXPECTED_GLIBC_VERSION" ]]; then | ||
echo "Error: File $file has dependency on GLIBC > $EXPECTED_GLIBC_VERSION" | ||
exit 1 | ||
fi | ||
if [[ "$glibcxx_version" != "$EXPECTED_GLIBCXX_VERSION" ]]; then | ||
echo "Error: File $file has dependency on GLIBCXX > $EXPECTED_GLIBCXX_VERSION" | ||
exit 1 | ||
fi | ||
done |
Oops, something went wrong.