Skip to content

Commit

Permalink
Merge branch 'master' into gotoline-negative
Browse files Browse the repository at this point in the history
  • Loading branch information
bpasero authored Aug 26, 2019
2 parents 33e53ee + 8b96058 commit 3faed6b
Show file tree
Hide file tree
Showing 672 changed files with 15,124 additions and 6,915 deletions.
10 changes: 5 additions & 5 deletions .github/commands.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
type: 'comment',
name: 'question',
allowUsers: ['cleidigh', 'usernamehw'],
allowUsers: ['cleidigh', 'usernamehw', 'gjsjohnmurray', 'IllusionMH'],
action: 'updateLabels',
addLabel: '*question'
},
Expand Down Expand Up @@ -60,7 +60,7 @@
{
type: 'comment',
name: 'duplicate',
allowUsers: ['cleidigh', 'usernamehw'],
allowUsers: ['cleidigh', 'usernamehw', 'gjsjohnmurray', 'IllusionMH'],
action: 'updateLabels',
addLabel: '*duplicate'
},
Expand All @@ -74,7 +74,7 @@
{
type: 'comment',
name: 'confirm',
allowUsers: ['cleidigh', 'usernamehw'],
allowUsers: ['cleidigh', 'usernamehw', 'gjsjohnmurray', 'IllusionMH'],
action: 'updateLabels',
addLabel: 'confirmed',
removeLabel: 'confirmation-pending'
Expand All @@ -90,14 +90,14 @@
{
type: 'comment',
name: 'findDuplicates',
allowUsers: ['cleidigh', 'usernamehw'],
allowUsers: ['cleidigh', 'usernamehw', 'gjsjohnmurray', 'IllusionMH'],
action: 'comment',
comment: "Potential duplicates:\n${potentialDuplicates}"
},
{
type: 'comment',
name: 'needsMoreInfo',
allowUsers: ['cleidigh', 'usernamehw'],
allowUsers: ['cleidigh', 'usernamehw', 'gjsjohnmurray', 'IllusionMH'],
action: 'updateLabels',
addLabel: 'needs more info',
comment: "Thanks for creating this issue! We figured it's missing some basic information or in some other way doesn't follow our [issue reporting](https://aka.ms/vscodeissuereporting) guidelines. Please take the time to review these and update the issue.\n\nHappy Coding!"
Expand Down
10 changes: 10 additions & 0 deletions build/azure-pipelines/darwin/product-build-darwin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,16 @@ steps:
displayName: Run integration tests
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))

- script: |
set -e
cd test/smoke
yarn compile
cd -
yarn smoketest --web --headless
continueOnError: true
displayName: Run web smoke tests
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))

- script: |
set -e
pushd ../VSCode-darwin && zip -r -X -y ../VSCode-darwin.zip * && popd
Expand Down
40 changes: 40 additions & 0 deletions build/azure-pipelines/exploration-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
pool:
vmImage: 'Ubuntu-16.04'

trigger:
branches:
include: ['master']
pr:
branches:
include: ['master']

steps:
- task: NodeTool@0
inputs:
versionSpec: "10.15.1"

- task: AzureKeyVault@1
displayName: 'Azure Key Vault: Get Secrets'
inputs:
azureSubscription: 'vscode-builds-subscription'
KeyVaultName: vscode

- script: |
set -e
cat << EOF > ~/.netrc
machine github.com
login vscode
password $(github-distro-mixin-password)
EOF
git config user.email "vscode@microsoft.com"
git config user.name "VSCode"
git checkout origin/electron-6.0.x
git merge origin/master
# Push master branch into exploration branch
git push origin HEAD:electron-6.0.x
displayName: Sync & Merge Exploration
2 changes: 1 addition & 1 deletion build/builtInExtensions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"name": "ms-vscode.node-debug",
"version": "1.38.2",
"version": "1.38.3",
"repo": "https://github.com/Microsoft/vscode-node-debug",
"metadata": {
"id": "b6ded8fb-a0a0-4c1c-acbd-ab2a3bc995a6",
Expand Down
53 changes: 41 additions & 12 deletions build/gulpfile.hygiene.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const indentationFilter = [
'!src/vs/css.js',
'!src/vs/css.build.js',
'!src/vs/loader.js',
'!src/vs/base/common/insane/insane.js',
'!src/vs/base/common/marked/marked.js',
'!src/vs/base/node/terminateProcess.sh',
'!src/vs/base/node/cpuUsage.sh',
Expand Down Expand Up @@ -131,24 +132,44 @@ const eslintFilter = [
'!src/vs/nls.js',
'!src/vs/css.build.js',
'!src/vs/nls.build.js',
'!src/**/insane.js',
'!src/**/marked.js',
'!**/test/**'
];

const tslintFilter = [
'src/**/*.ts',
'test/**/*.ts',
'extensions/**/*.ts',
const tslintBaseFilter = [
'!**/fixtures/**',
'!**/typings/**',
'!**/node_modules/**',
'!extensions/typescript/test/colorize-fixtures/**',
'!extensions/typescript-basics/test/colorize-fixtures/**',
'!extensions/vscode-api-tests/testWorkspace/**',
'!extensions/vscode-api-tests/testWorkspace2/**',
'!extensions/**/*.test.ts',
'!extensions/html-language-features/server/lib/jquery.d.ts'
];

const tslintCoreFilter = [
'src/**/*.ts',
'test/**/*.ts',
'!extensions/**/*.ts',
'!test/smoke/**',
...tslintBaseFilter
];

const tslintExtensionsFilter = [
'extensions/**/*.ts',
'!src/**/*.ts',
'!test/**/*.ts',
...tslintBaseFilter
];

const tslintHygieneFilter = [
'src/**/*.ts',
'test/**/*.ts',
'extensions/**/*.ts',
...tslintBaseFilter
];

const copyrightHeaderLines = [
'/*---------------------------------------------------------------------------------------------',
' * Copyright (c) Microsoft Corporation. All rights reserved.',
Expand All @@ -165,12 +186,20 @@ gulp.task('eslint', () => {
});

gulp.task('tslint', () => {
const options = { emitError: true };

return vfs.src(all, { base: '.', follow: true, allowEmpty: true })
.pipe(filter(tslintFilter))
.pipe(gulptslint.default({ rulesDirectory: 'build/lib/tslint' }))
.pipe(gulptslint.default.report(options));
return es.merge([

// Core: include type information (required by certain rules like no-nodejs-globals)
vfs.src(all, { base: '.', follow: true, allowEmpty: true })
.pipe(filter(tslintCoreFilter))
.pipe(gulptslint.default({ rulesDirectory: 'build/lib/tslint', program: tslint.Linter.createProgram('src/tsconfig.json') }))
.pipe(gulptslint.default.report({ emitError: true })),

// Exenstions: do not include type information
vfs.src(all, { base: '.', follow: true, allowEmpty: true })
.pipe(filter(tslintExtensionsFilter))
.pipe(gulptslint.default({ rulesDirectory: 'build/lib/tslint' }))
.pipe(gulptslint.default.report({ emitError: true }))
]).pipe(es.through());
});

function hygiene(some) {
Expand Down Expand Up @@ -283,7 +312,7 @@ function hygiene(some) {
.pipe(copyrights);

const typescript = result
.pipe(filter(tslintFilter))
.pipe(filter(tslintHygieneFilter))
.pipe(formatting)
.pipe(tsl);

Expand Down
6 changes: 5 additions & 1 deletion build/gulpfile.vscode.web.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ const vscodeWebResources = [
// Webview
'out-build/vs/workbench/contrib/webview/browser/pre/*.js',

// Extension Worker
'out-build/vs/workbench/services/extensions/worker/extensionHostWorkerMain.js',

// Excludes
'!out-build/vs/**/{node,electron-browser,electron-main}/**',
'!out-build/vs/editor/standalone/**',
Expand All @@ -53,6 +56,7 @@ const buildfile = require('../src/buildfile');
const vscodeWebEntryPoints = [
buildfile.workbenchWeb,
buildfile.serviceWorker,
buildfile.workerExtensionHost,
buildfile.keyboardMaps,
buildfile.base
];
Expand Down Expand Up @@ -148,4 +152,4 @@ const dashed = (str) => (str ? `-${str}` : ``);
vscodeWebTaskCI
));
gulp.task(vscodeWebTask);
});
});
45 changes: 45 additions & 0 deletions build/lib/tslint/abstractGlobalsRule.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
"use strict";
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true });
const Lint = require("tslint");
class AbstractGlobalsRuleWalker extends Lint.RuleWalker {
constructor(file, program, opts, _config) {
super(file, opts);
this.program = program;
this._config = _config;
}
visitIdentifier(node) {
if (this.getDisallowedGlobals().some(disallowedGlobal => disallowedGlobal === node.text)) {
if (this._config.allowed && this._config.allowed.some(allowed => allowed === node.text)) {
return; // override
}
const checker = this.program.getTypeChecker();
const symbol = checker.getSymbolAtLocation(node);
if (symbol) {
const declarations = symbol.declarations;
if (Array.isArray(declarations) && symbol.declarations.some(declaration => {
if (declaration) {
const parent = declaration.parent;
if (parent) {
const sourceFile = parent.getSourceFile();
if (sourceFile) {
const fileName = sourceFile.fileName;
if (fileName && fileName.indexOf(this.getDefinitionPattern()) >= 0) {
return true;
}
}
}
}
return false;
})) {
this.addFailureAtNode(node, `Cannot use global '${node.text}' in '${this._config.target}'`);
}
}
}
super.visitIdentifier(node);
}
}
exports.AbstractGlobalsRuleWalker = AbstractGlobalsRuleWalker;
57 changes: 57 additions & 0 deletions build/lib/tslint/abstractGlobalsRule.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import * as ts from 'typescript';
import * as Lint from 'tslint';

interface AbstractGlobalsRuleConfig {
target: string;
allowed: string[];
}

export abstract class AbstractGlobalsRuleWalker extends Lint.RuleWalker {

constructor(file: ts.SourceFile, private program: ts.Program, opts: Lint.IOptions, private _config: AbstractGlobalsRuleConfig) {
super(file, opts);
}

protected abstract getDisallowedGlobals(): string[];

protected abstract getDefinitionPattern(): string;

visitIdentifier(node: ts.Identifier) {
if (this.getDisallowedGlobals().some(disallowedGlobal => disallowedGlobal === node.text)) {
if (this._config.allowed && this._config.allowed.some(allowed => allowed === node.text)) {
return; // override
}

const checker = this.program.getTypeChecker();
const symbol = checker.getSymbolAtLocation(node);
if (symbol) {
const declarations = symbol.declarations;
if (Array.isArray(declarations) && symbol.declarations.some(declaration => {
if (declaration) {
const parent = declaration.parent;
if (parent) {
const sourceFile = parent.getSourceFile();
if (sourceFile) {
const fileName = sourceFile.fileName;
if (fileName && fileName.indexOf(this.getDefinitionPattern()) >= 0) {
return true;
}
}
}
}

return false;
})) {
this.addFailureAtNode(node, `Cannot use global '${node.text}' in '${this._config.target}'`);
}
}
}

super.visitIdentifier(node);
}
}
34 changes: 34 additions & 0 deletions build/lib/tslint/noDomGlobalsRule.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
"use strict";
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true });
const Lint = require("tslint");
const minimatch = require("minimatch");
const abstractGlobalsRule_1 = require("./abstractGlobalsRule");
class Rule extends Lint.Rules.TypedRule {
applyWithProgram(sourceFile, program) {
const configs = this.getOptions().ruleArguments;
for (const config of configs) {
if (minimatch(sourceFile.fileName, config.target)) {
return this.applyWithWalker(new NoDOMGlobalsRuleWalker(sourceFile, program, this.getOptions(), config));
}
}
return [];
}
}
exports.Rule = Rule;
class NoDOMGlobalsRuleWalker extends abstractGlobalsRule_1.AbstractGlobalsRuleWalker {
getDefinitionPattern() {
return 'lib.dom.d.ts';
}
getDisallowedGlobals() {
// intentionally not complete
return [
"window",
"document",
"HTMLElement"
];
}
}
Loading

0 comments on commit 3faed6b

Please sign in to comment.