Skip to content

Commit

Permalink
Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
rchiodo committed Feb 20, 2020
1 parent 4685573 commit 7c81cfc
Show file tree
Hide file tree
Showing 892 changed files with 29,379 additions and 7,339 deletions.
2 changes: 1 addition & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
singleQuote: true,
printWidth: 180,
printWidth: 120,
tabWidth: 4,
overrides: [
{
Expand Down
31 changes: 27 additions & 4 deletions build/ci/performance/checkPerformanceResults.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ const path = require('path');
const constants = require('../../constants');

const xmlFile = path.join(constants.ExtensionRootDir, 'test-results.xml');
const performanceResultsFile = path.join(constants.ExtensionRootDir, 'build', 'ci', 'performance', 'performance-results.json');
const performanceResultsFile = path.join(
constants.ExtensionRootDir,
'build',
'ci',
'performance',
'performance-results.json'
);
const errorMargin = 0.01;
let failedTests = '';

Expand Down Expand Up @@ -40,12 +46,29 @@ fs.readFile(xmlFile, 'utf8', (xmlFileError, xmlData) => {

// compare the average result to the base JSON
if (testcase && avg > parseFloat(testcase.time) + errorMargin) {
failedTests += 'Performance is slow in: ' + testcase.name + ', Benchmark time: ' + testcase.time + ', Average test time: ' + avg + '\n';
failedTests +=
'Performance is slow in: ' +
testcase.name +
', Benchmark time: ' +
testcase.time +
', Average test time: ' +
avg +
'\n';
}
} else {
// compare the average result to the base JSON
if (suite.testcase.name === result.name && avg > parseFloat(suite.testcase.time) + errorMargin) {
failedTests += 'Performance is slow in: ' + testcase.name + ', Benchmark time: ' + testcase.time + ', Average test time: ' + avg + '\n';
if (
suite.testcase.name === result.name &&
avg > parseFloat(suite.testcase.time) + errorMargin
) {
failedTests +=
'Performance is slow in: ' +
testcase.name +
', Benchmark time: ' +
testcase.time +
', Average test time: ' +
avg +
'\n';
}
}
}
Expand Down
11 changes: 10 additions & 1 deletion build/ci/postInstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,16 @@ var constants_1 = require('../constants');
* The solution is to modify the type definition file after `npm install`.
*/
function fixJupyterLabDTSFiles() {
var relativePath = path.join('node_modules', '@jupyterlab', 'services', 'node_modules', '@jupyterlab', 'coreutils', 'lib', 'settingregistry.d.ts');
var relativePath = path.join(
'node_modules',
'@jupyterlab',
'services',
'node_modules',
'@jupyterlab',
'coreutils',
'lib',
'settingregistry.d.ts'
);
var filePath = path.join(constants_1.ExtensionRootDir, relativePath);
if (!fs.existsSync(filePath)) {
throw new Error("Type Definition file from JupyterLab not found '" + filePath + "' (pvsc post install script)");
Expand Down
11 changes: 10 additions & 1 deletion build/webpack/loaders/fixNodeFetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,16 @@
const path = require('path');
const constants = require('../../constants');

const nodeFetchIndexFile = path.join(constants.ExtensionRootDir, 'node_modules', '@jupyterlab', 'services', 'node_modules', 'node-fetch', 'lib', 'index.js');
const nodeFetchIndexFile = path.join(
constants.ExtensionRootDir,
'node_modules',
'@jupyterlab',
'services',
'node_modules',
'node-fetch',
'lib',
'index.js'
);
// On windows replace `\` with `\\`, else we get an error in webpack (Module parse failed: Octal literal in strict mode).
const nodeFetchFile = constants.isWindows ? nodeFetchIndexFile.replace(/\\/g, '\\\\') : nodeFetchIndexFile;

Expand Down
7 changes: 6 additions & 1 deletion build/webpack/plugins/less-plugin-base64.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@ class Base64Visitor {
visitUrl(URLNode, visitArgs) {
// Return two new nodes in the call. One that has the mime type and other with the node. The data-uri
// evaluator will transform this into a base64 string
return new less.tree.Call('data-uri', [new Base64MimeTypeNode(), URLNode.value], URLNode.index || 0, URLNode.currentFileInfo);
return new less.tree.Call(
'data-uri',
[new Base64MimeTypeNode(), URLNode.value],
URLNode.index || 0,
URLNode.currentFileInfo
);
}
}
/*
Expand Down
13 changes: 10 additions & 3 deletions build/webpack/webpack.datascience-ui.config.builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,10 @@ function buildConfiguration(isNotebook) {
// `module.resource` contains the absolute path of the file on disk.
// Look for `node_modules/monaco...`.
const path = require('path');
return module.resource && module.resource.includes(`${path.sep}node_modules${path.sep}@nteract`);
return (
module.resource &&
module.resource.includes(`${path.sep}node_modules${path.sep}@nteract`)
);
}
},
// Bundling `plotly` with nteract isn't the best option, as this plotly alone is 6mb.
Expand All @@ -142,7 +145,9 @@ function buildConfiguration(isNotebook) {
// `module.resource` contains the absolute path of the file on disk.
// Look for `node_modules/monaco...`.
const path = require('path');
return module.resource && module.resource.includes(`${path.sep}node_modules${path.sep}plotly`);
return (
module.resource && module.resource.includes(`${path.sep}node_modules${path.sep}plotly`)
);
}
},
// Monaco is a monster. For SSH again, we pull this into a seprate bundle.
Expand All @@ -157,7 +162,9 @@ function buildConfiguration(isNotebook) {
// `module.resource` contains the absolute path of the file on disk.
// Look for `node_modules/monaco...`.
const path = require('path');
return module.resource && module.resource.includes(`${path.sep}node_modules${path.sep}monaco`);
return (
module.resource && module.resource.includes(`${path.sep}node_modules${path.sep}monaco`)
);
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion build/webpack/webpack.extension.dependencies.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ const config = {
// 'find' the calling extension.
new copyWebpackPlugin([{ from: './package.json', to: '.' }]),
// onigasm requires our onigasm.wasm to be in node_modules
new copyWebpackPlugin([{ from: './node_modules/onigasm/lib/onigasm.wasm', to: './node_modules/onigasm/lib/onigasm.wasm' }])
new copyWebpackPlugin([
{ from: './node_modules/onigasm/lib/onigasm.wasm', to: './node_modules/onigasm/lib/onigasm.wasm' }
])
],
resolve: {
alias: {
Expand Down
2 changes: 0 additions & 2 deletions experiments.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

[
{
"name": "AlwaysDisplayTestExplorer - experiment",
Expand Down Expand Up @@ -115,4 +114,3 @@
"max": 100
}
]

Loading

0 comments on commit 7c81cfc

Please sign in to comment.