From a68d261ff75d2f646ea6b02683f2989f1f5234ff Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Mon, 18 Sep 2017 23:36:54 -0700 Subject: [PATCH 01/10] sanitize code --- .editorconfig | 16 + .eslintrc | 15 + .vscode/tasks.json | 71 +- build/gulpfile.hygiene.js | 378 +++++ build/tslint.json | 27 + package.json | 3032 +++++++++++++++++++------------------ tsfmt.json | 16 + tslint.json | 22 +- 8 files changed, 2047 insertions(+), 1530 deletions(-) create mode 100644 .editorconfig create mode 100644 .eslintrc create mode 100644 build/gulpfile.hygiene.js create mode 100644 build/tslint.json create mode 100644 tsfmt.json diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000000..b6161dff7746 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,16 @@ +# EditorConfig is awesome: http://EditorConfig.org + +# top-most EditorConfig file +root = true + +# Tab indentation +[*] +indent_style = space +indent_size = 4 +trim_trailing_whitespace = true + +# The indent size used in the `package.json` file cannot be changed +# https://github.com/npm/npm/pull/3180#issuecomment-16336516 +[{.travis.yml,npm-shrinkwrap.json,package.json}] +indent_style = space +indent_size = 4 \ No newline at end of file diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 000000000000..ddf13cefc83c --- /dev/null +++ b/.eslintrc @@ -0,0 +1,15 @@ + +{ + "env": { + "node": true, + "es6": true + }, + "rules": { + "no-console": 0, + "no-cond-assign": 0, + "no-unused-vars": 1, + "no-extra-semi": "warn", + "semi": "warn" + }, + "extends": "eslint:recommended" +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json index d31b15910eed..b609ee31923f 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,30 +1,57 @@ -// Available variables which can be used inside of strings. -// ${workspaceRoot}: the root folder of the team -// ${file}: the current opened file -// ${fileBasename}: the current opened file's basename -// ${fileDirname}: the current opened file's dirname -// ${fileExtname}: the current opened file's extension -// ${cwd}: the current working directory of the spawned process +// // Available variables which can be used inside of strings. +// // ${workspaceRoot}: the root folder of the team +// // ${file}: the current opened file +// // ${fileBasename}: the current opened file's basename +// // ${fileDirname}: the current opened file's dirname +// // ${fileExtname}: the current opened file's extension +// // ${cwd}: the current working directory of the spawned process -// A task runner that calls a custom npm script that compiles the extension. -{ - "version": "0.1.0", +// // A task runner that calls a custom npm script that compiles the extension. +// { +// "version": "0.1.0", - // we want to run npm - "command": "npm", +// // we want to run npm +// "command": "npm", - // the command is a shell script - "isShellCommand": true, +// // the command is a shell script +// "isShellCommand": true, - // show the output window only if unrecognized errors occur. - "showOutput": "silent", +// // show the output window only if unrecognized errors occur. +// "showOutput": "silent", - // we run the custom script "compile" as defined in package.json - "args": ["run", "compile", "--loglevel", "silent"], +// // we run the custom script "compile" as defined in package.json +// "args": ["run", "compile", "--loglevel", "silent"], - // The tsc compiler is started in watching mode - "isWatching": true, +// // The tsc compiler is started in watching mode +// "isWatching": true, - // use the standard tsc in watch mode problem matcher to find compile problems in the output. - "problemMatcher": "$tsc-watch" +// // use the standard tsc in watch mode problem matcher to find compile problems in the output. +// "problemMatcher": "$tsc-watch" +// } +{ + "version": "0.1.0", + "tasks": [{ + "isShellCommand": true, + "args": [ + "run", "compile", "--loglevel", "silent" + ], + "isBackground": true, + "command": "npm", + "taskName": "build", + "showOutput": "silent", + "isBuildCommand": true, + "problemMatcher": [ + "$tsc-watch" + ] + }, + { + "command": "npm", + "script": "lint", + "taskName": "lint", + "problemMatcher": { + "base": "$tslint5", + "fileLocation": "relative" + } + } + ] } \ No newline at end of file diff --git a/build/gulpfile.hygiene.js b/build/gulpfile.hygiene.js new file mode 100644 index 000000000000..8476cc0a37cd --- /dev/null +++ b/build/gulpfile.hygiene.js @@ -0,0 +1,378 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +'use strict'; + +const gulp = require('gulp'); +const filter = require('gulp-filter'); +const es = require('event-stream'); +const gulptslint = require('gulp-tslint'); +const gulpeslint = require('gulp-eslint'); +const tsfmt = require('typescript-formatter'); +const tslint = require('tslint'); +const path = require('path'); +const fs = require('fs'); + +/** + * Hygiene works by creating cascading subsets of all our files and + * passing them through a sequence of checks. Here are the current subsets, + * named according to the checks performed on them. Each subset contains + * the following one, as described in mathematical notation: + * + * all ⊃ eol ⊇ indentation ⊃ copyright ⊃ typescript + */ + +const all = [ + 'src/**/*', + 'src/client/**/*', +]; + +const eolFilter = [ + '**', + '!ThirdPartyNotices.txt', + '!LICENSE.txt', + '!extensions/**/out/**', + '!test/smoke/out/**', + '!**/node_modules/**', + '!**/fixtures/**', + '!**/*.{svg,exe,png,bmp,scpt,bat,cmd,cur,ttf,woff,eot}', + '!build/{lib,tslintRules}/**/*.js', + '!build/monaco/**', + '!build/win32/**', + '!build/**/*.sh', + '!build/tfs/**/*.js', + '!**/Dockerfile', + '!build/**/*', + '!out/**/*', + '!images/**/*', + '!docs/**/*', + '!.vscode/**/*', + '!pythonFiles/**/*', + '!resources/**/*', + '!snippets/**/*', + '!syntaxes/**/*', + '!typings/**/*', +]; + +const indentationFilter = [ + '**', + '!ThirdPartyNotices.txt', + '!**/*.md', + '!**/*.ps1', + '!**/*.template', + '!**/*.yml', + '!**/lib/**', + '!extensions/**/*.d.ts', + '!src/typings/**/*.d.ts', + '!src/vs/*/**/*.d.ts', + '!**/*.d.ts.recipe', + '!test/assert.js', + '!**/package.json', + '!**/npm-shrinkwrap.json', + '!**/octicons/**', + '!**/vs/base/common/marked/raw.marked.js', + '!**/vs/base/common/winjs.base.raw.js', + '!**/vs/base/node/terminateProcess.sh', + '!**/vs/nls.js', + '!**/vs/css.js', + '!**/vs/loader.js', + '!extensions/**/snippets/**', + '!extensions/**/syntaxes/**', + '!extensions/**/themes/**', + '!extensions/**/colorize-fixtures/**', + '!extensions/vscode-api-tests/testWorkspace/**', + '!build/**/*', + '!out/**/*', + '!images/**/*', + '!docs/**/*', + '!.vscode/**/*', + '!pythonFiles/**/*', + '!resources/**/*', + '!snippets/**/*', + '!syntaxes/**/*', + '!typings/**/*', +]; + +const copyrightFilter = [ + '**', + '!**/*.desktop', + '!**/*.json', + '!**/*.html', + '!**/*.template', + '!**/*.md', + '!**/*.bat', + '!**/*.cmd', + '!**/*.xml', + '!**/*.sh', + '!**/*.txt', + '!**/*.xpm', + '!**/*.opts', + '!**/*.disabled', + '!build/**/*.init', + '!resources/win32/bin/code.js', + '!extensions/markdown/media/tomorrow.css', + '!extensions/html/server/src/modes/typescript/*', + '!build/**/*', + '!out/**/*', + '!images/**/*', + '!docs/**/*', + '!.vscode/**/*', + '!pythonFiles/**/*', + '!resources/**/*', + '!snippets/**/*', + '!syntaxes/**/*', + '!typings/**/*', +]; + +const eslintFilter = [ + 'src/**/*.js', + 'build/gulpfile.*.js', + '!src/vs/loader.js', + '!src/vs/css.js', + '!src/vs/nls.js', + '!src/vs/css.build.js', + '!src/vs/nls.build.js', + '!src/**/winjs.base.raw.js', + '!src/**/raw.marked.js', + '!**/test/**', + '!build/**/*', + '!out/**/*', + '!images/**/*', + '!docs/**/*', + '!.vscode/**/*', + '!pythonFiles/**', + '!resources/**', + '!snippets/**', + '!syntaxes/**', + '!typings/**', +]; + +const tslintFilter = [ + 'src/**/*.ts', + 'test/**/*.ts', + 'extensions/**/*.ts', + '!**/fixtures/**', + '!**/typings/**', + '!**/node_modules/**', + '!extensions/typescript/test/colorize-fixtures/**', + '!extensions/vscode-api-tests/testWorkspace/**', + '!extensions/**/*.test.ts', + '!build/**', + '!out/**', + '!images/**', + '!docs/**', + '!.vscode/**', + '!pythonFiles/**', + '!resources/**', + '!snippets/**', + '!syntaxes/**', + '!typings/**', +]; + +const copyrightHeader = [ + '/*---------------------------------------------------------------------------------------------', + ' * Copyright (c) Microsoft Corporation. All rights reserved.', + ' * Licensed under the MIT License. See License.txt in the project root for license information.', + ' *--------------------------------------------------------------------------------------------*/' +].join('\n'); + +function reportFailures(failures) { + failures.forEach(failure => { + const name = failure.name || failure.fileName; + const position = failure.startPosition; + const line = position.lineAndCharacter ? position.lineAndCharacter.line : position.line; + const character = position.lineAndCharacter ? position.lineAndCharacter.character : position.character; + + console.error(`${name}:${line + 1}:${character + 1}:${failure.failure}`); + }); +} + +gulp.task('eslint', () => { + return gulp.src(all, { + base: '.' + }) + .pipe(filter(eslintFilter)) + .pipe(gulpeslint('.eslintrc')) + .pipe(gulpeslint.formatEach('compact')) + .pipe(gulpeslint.failAfterError()); +}); + +gulp.task('tslint', () => { + const options = { + summarizeFailureOutput: true + }; + + return gulp.src(all, { + base: '.' + }) + .pipe(filter(tslintFilter)) + .pipe(gulptslint({ + rulesDirectory: 'build/lib/tslint' + })) + .pipe(gulptslint.report(reportFailures, options)); +}); + +const hygiene = exports.hygiene = (some, options) => { + options = options || {}; + let errorCount = 0; + const eol = es.through(function (file) { + if (/\r\n?/g.test(file.contents.toString('utf8'))) { + console.error(file.relative + ': Bad EOL found'); + errorCount++; + } + + this.emit('data', file); + }); + + const indentation = es.through(function (file) { + file.contents + .toString('utf8') + .split(/\r\n|\r|\n/) + .forEach((line, i) => { + if (/^\s*$/.test(line)) { + // empty or whitespace lines are OK + } else if (/^[\t]*[^\s]/.test(line)) { + // good indent + } else if (/^[\t]* \*/.test(line)) { + // block comment using an extra space + } else { + console.error(file.relative + '(' + (i + 1) + ',1): Bad whitespace indentation'); + errorCount++; + } + }); + + this.emit('data', file); + }); + + const copyrights = es.through(function (file) { + if (file.contents.toString('utf8').indexOf(copyrightHeader) !== 0) { + console.error(file.relative + ': Missing or bad copyright statement'); + errorCount++; + } + + this.emit('data', file); + }); + + const formatting = es.map(function (file, cb) { + tsfmt.processString(file.path, file.contents.toString('utf8'), { + verify: true, + tsfmt: true, + editorconfig: true + // verbose: true + }).then(result => { + console.error('Has Error'); + console.error(result.error); + if (result.error) { + console.error(result.message); + errorCount++; + } + cb(null, file); + + }, err => { + cb(err); + }); + }); + + const tsl = es.through(function (file) { + const configuration = tslint.Configuration.findConfiguration(null, '.'); + const options = { + formatter: 'json', + // rulesDirectory: ['node_modules/tslint-microsoft-contrib', 'node_modules/tslint-eslint-rules'] + }; + const contents = file.contents.toString('utf8'); + const linter = new tslint.Linter(options); + linter.lint(file.relative, contents, configuration.results); + const result = linter.getResult(); + if (result.failureCount > 0 || result.errorCount > 0) { + reportFailures(result.failures); + if (result.failureCount) { + errorCount += result.failureCount; + } + if (result.errorCount) { + errorCount += result.errorCount; + } + } + + this.emit('data', file); + }); + + const result = gulp.src(some || all, { + base: '.' + }) + .pipe(filter(f => !f.stat.isDirectory())) + .pipe(filter(eolFilter)) + .pipe(options.skipEOL ? es.through() : eol) + .pipe(filter(indentationFilter)); + // .pipe(indentation) + // .pipe(filter(copyrightFilter)) + // .pipe(copyrights); + + const typescript = result + .pipe(filter(tslintFilter)) + // .pipe(formatting) + .pipe(tsl); + + // const javascript = result + // .pipe(filter(eslintFilter)) + // .pipe(gulpeslint('.eslintrc')) + // .pipe(gulpeslint.formatEach('compact')) + // .pipe(gulpeslint.failAfterError()); + + return es.merge(typescript) + .pipe(es.through(null, function () { + if (errorCount > 0) { + this.emit('error', 'Hygiene failed with ' + errorCount + ' errors. Check \'build/gulpfile.hygiene.js\'.'); + } else { + this.emit('end'); + } + })); +}; + +gulp.task('hygiene', () => hygiene()); + +// this allows us to run hygiene as a git pre-commit hook +if (require.main === module) { + const cp = require('child_process'); + + process.on('unhandledRejection', (reason, p) => { + console.log('Unhandled Rejection at: Promise', p, 'reason:', reason); + process.exit(1); + }); + + cp.exec('git config core.autocrlf', (err, out) => { + const skipEOL = out.trim() === 'true'; + + if (process.argv.length > 2) { + return hygiene(process.argv.slice(2), { + skipEOL: skipEOL + }).on('error', err => { + console.error(); + console.error(err); + process.exit(1); + }); + } + + cp.exec('git diff --cached --name-only', { + maxBuffer: 2000 * 1024 + }, (err, out) => { + if (err) { + console.error(); + console.error(err); + process.exit(1); + } + + const some = out + .split(/\r?\n/) + .filter(l => !!l); + hygiene(some, { + skipEOL: skipEOL + }).on('error', err => { + console.error(); + console.error(err); + process.exit(1); + }); + }); + }); +} \ No newline at end of file diff --git a/build/tslint.json b/build/tslint.json new file mode 100644 index 000000000000..38f630938153 --- /dev/null +++ b/build/tslint.json @@ -0,0 +1,27 @@ +{ + "extends": [ + "tslint-eslint-rules", + "tslint-microsoft-contrib" + ], + "rules": { + "no-unused-expression": true, + "no-duplicate-variable": true, + "no-unused-variable": true, + "curly": true, + "class-name": true, + "semicolon": [ + true + ], + "triple-equals": true, + "no-relative-imports": false, + "max-line-length": false, + "typedef": false, + "no-string-throw": true, + "missing-jsdoc": false, + "one-line": false, + "no-parameter-properties": false, + "no-reserved-keywords": false, + "newline-before-return": false, + "export-name": false + } +} \ No newline at end of file diff --git a/package.json b/package.json index 8e8db57e6655..944df1105fbc 100644 --- a/package.json +++ b/package.json @@ -1,1506 +1,1530 @@ { - "name": "python", - "displayName": "Python", - "description": "Linting, Debugging (multi-threaded, remote), Intellisense, code formatting, refactoring, unit tests, snippets, Data Science (with Jupyter), PySpark and more.", - "version": "0.7.0", - "publisher": "donjayamanne", - "author": { - "name": "Don Jayamanne", - "email": "don.jayamanne@yahoo.com" - }, - "license": "MIT", - "homepage": "http://donjayamanne.github.io/pythonVSCode/", - "repository": { - "type": "git", - "url": "https://github.com/DonJayamanne/pythonVSCode" - }, - "bugs": { - "url": "https://github.com/DonJayamanne/pythonVSCode/issues" - }, - "icon": "icon.png", - "galleryBanner": { - "color": "#1e415e", - "theme": "dark" - }, - "engines": { - "vscode": "^1.9.0" - }, - "recommendations": [ - "donjayamanne.jupyter" - ], - "keywords": [ - "python", - "jupyter", - "django", - "debugger", - "unittest" - ], - "categories": [ - "Languages", - "Debuggers", - "Linters", - "Snippets", - "Formatters", - "Other" - ], - "activationEvents": [ - "onLanguage:python", - "onCommand:python.python-debug.startSession", - "onCommand:python.execInTerminal", - "onCommand:python.sortImports", - "onCommand:python.runtests", - "onCommand:python.debugtests", - "onCommand:python.setInterpreter", - "onCommand:python.viewTestUI", - "onCommand:python.viewTestOutput", - "onCommand:python.selectAndRunTestMethod", - "onCommand:python.selectAndDebugTestMethod", - "onCommand:python.selectAndRunTestFile", - "onCommand:python.runCurrentTestFile", - "onCommand:python.runFailedTests", - "onCommand:python.execSelectionInTerminal", - "onCommand:python.execSelectionInDjangoShell", - "onCommand:jupyter.runSelectionLine", - "onCommand:jupyter.execCurrentCell", - "onCommand:jupyter.execCurrentCellAndAdvance", - "onCommand:python.displayHelp", - "onCommand:python.buildWorkspaceSymbols", - "onCommand:python.updateSparkLibrary", - "onCommand:python.startREPL", - "onCommand:python.goToPythonObject" - ], - "main": "./out/client/extension", - "contributes": { - "snippets": [{ - "language": "python", - "path": "./snippets/python.json" - }], - "keybindings": [{ - "command": "jupyter.runSelectionLine", - "key": "ctrl+alt+enter", - "when": "editorFocus && !replaceActive && !searchViewletVisible && !findWidgetVisible" - }], - "commands": [{ - "command": "python.sortImports", - "title": "Sort Imports", - "category": "Python Refactor" - }, - { - "command": "python.startREPL", - "title": "Start REPL", - "category": "Python" - }, - { - "command": "python.buildWorkspaceSymbols", - "title": "Build Workspace Symbols", - "category": "Python" - }, - { - "command": "python.runtests", - "title": "Run All Unit Tests", - "category": "Python" - }, - { - "command": "python.debugtests", - "title": "Debug All Unit Tests", - "category": "Python" - }, - { - "command": "python.execInTerminal", - "title": "Run Python File in Terminal", - "category": "Python" - }, - { - "command": "python.setInterpreter", - "title": "Select Workspace Interpreter", - "category": "Python" - }, - { - "command": "python.updateSparkLibrary", - "title": "Update Workspace PySpark Libraries", - "category": "Python" - }, - { - "command": "python.refactorExtractVariable", - "title": "Extract Variable", - "category": "Python Refactor" - }, - { - "command": "python.refactorExtractMethod", - "title": "Extract Method", - "category": "Python Refactor" - }, - { - "command": "python.viewTestOutput", - "title": "Show Unit Test Output", - "category": "Python" - }, - { - "command": "python.selectAndRunTestMethod", - "title": "Run Unit Test Method ...", - "category": "Python" - }, - { - "command": "python.selectAndDebugTestMethod", - "title": "Debug Unit Test Method ...", - "category": "Python" - }, - { - "command": "python.selectAndRunTestFile", - "title": "Run Unit Test File ...", - "category": "Python" - }, - { - "command": "python.runCurrentTestFile", - "title": "Run Current Unit Test File", - "category": "Python" - }, - { - "command": "python.runFailedTests", - "title": "Run Failed Unit Tests", - "category": "Python" - }, - { - "command": "python.execSelectionInTerminal", - "title": "Run Selection/Line in Python Terminal", - "category": "Python" - }, - { - "command": "python.execSelectionInDjangoShell", - "title": "Run Selection/Line in Django Shell", - "category": "Python" - }, - { - "command": "jupyter.runSelectionLine", - "title": "Run Selection/Line", - "category": "Jupyter" - }, - { - "command": "jupyter.execCurrentCell", - "title": "Run Cell", - "category": "Jupyter" - }, - { - "command": "jupyter.execCurrentCellAndAdvance", - "title": "Run Cell and Advance", - "category": "Jupyter" - }, - { - "command": "jupyter.gotToPreviousCell", - "title": "Go to Previous Cell", - "category": "Jupyter" - }, - { - "command": "jupyter.gotToNextCell", - "title": "Go to Next Cell", - "category": "Jupyter" - }, - { - "command": "python.displayHelp", - "title": "Help", - "category": "Python" - }, - { - "command": "python.goToPythonObject", - "title": "Go to Python Object", - "category": "Python" - } - ], - "menus": { - "editor/context": [{ - "command": "python.refactorExtractVariable", - "title": "Refactor: Extract Variable", - "group": "Refactor", - "when": "editorHasSelection && editorLangId == python" - }, - { - "command": "python.refactorExtractMethod", - "title": "Refactor: Extract Method", - "group": "Refactor", - "when": "editorHasSelection && editorLangId == python" - }, - { - "command": "python.sortImports", - "title": "Refactor: Sort Imports", - "group": "Refactor", - "when": "editorLangId == python" - }, - { - "command": "python.execSelectionInTerminal", - "group": "Python", - "when": "editorHasSelection && editorLangId == python" - }, - { - "command": "python.execSelectionInDjangoShell", - "group": "Python", - "when": "editorHasSelection && editorLangId == python && python.isDjangoProject" - }, - { - "when": "resourceLangId == python", - "command": "python.execInTerminal", - "group": "Python" - }, - { - "when": "resourceLangId == python", - "command": "python.runCurrentTestFile", - "group": "Python" - } - ], - "explorer/context": [{ - "when": "resourceLangId == python", - "command": "python.runtests", - "group": "Python" - }, - { - "when": "resourceLangId == python", - "command": "python.debugtests", - "group": "Python" - }, - { - "when": "resourceLangId == python", - "command": "python.execInTerminal", - "group": "Python" - } - ] - }, - "debuggers": [{ - "type": "python", - "label": "Python", - "languages": [ - "python" - ], - "startSessionCommand": "python.python-debug.startSession", - "enableBreakpointsFor": { - "languageIds": [ - "python", - "html" - ] - }, - "aiKey": "fce7a3d5-4665-4404-b786-31a6306749a6", - "program": "./out/client/debugger/Main.js", - "runtime": "node", - "configurationSnippets": [{ - "label": "%python.snippet.launch.standard.label%", - "description": "%python.snippet.launch.standard.description%", - "body": { - "name": "Python", - "type": "python", - "request": "launch", - "stopOnEntry": true, - "pythonPath": "^\"\\${config:python.pythonPath}\"", - "program": "^\"\\${file}\"", - "cwd": "^\"\\${workspaceRoot}\"", - "env": {}, - "envFile": "^\"\\${workspaceRoot}/.env\"", - "debugOptions": [ - "WaitOnAbnormalExit", - "WaitOnNormalExit", - "RedirectOutput" - ] - } - }, - { - "label": "%python.snippet.launch.pyspark.label%", - "description": "%python.snippet.launch.pyspark.description%", - "body": { - "name": "PySpark", - "type": "python", - "request": "launch", - "stopOnEntry": true, - "osx": { - "pythonPath": "^\"\\${env:SPARK_HOME}/bin/spark-submit\"" - }, - "windows": { - "pythonPath": "^\"\\${env:SPARK_HOME}/bin/spark-submit.cmd\"" - }, - "linux": { - "pythonPath": "^\"\\${env:SPARK_HOME}/bin/spark-submit\"" - }, - "program": "^\"\\${file}\"", - "cwd": "^\"\\${workspaceRoot}\"", - "env": {}, - "envFile": "^\"\\${workspaceRoot}/.env\"", - "debugOptions": [ - "WaitOnAbnormalExit", - "WaitOnNormalExit", - "RedirectOutput" - ] - } - }, - { - "label": "%python.snippet.launch.module.label%", - "description": "%python.snippet.launch.module.description%", - "body": { - "name": "Python Module", - "type": "python", - "request": "launch", - "stopOnEntry": true, - "pythonPath": "^\"\\${config:python.pythonPath}\"", - "module": "module.name", - "cwd": "^\"\\${workspaceRoot}\"", - "env": {}, - "envFile": "^\"\\${workspaceRoot}/.env\"", - "debugOptions": [ - "WaitOnAbnormalExit", - "WaitOnNormalExit", - "RedirectOutput" - ] - } - }, - { - "label": "%python.snippet.launch.terminal.label%", - "description": "%python.snippet.launch.terminal.description%", - "body": { - "name": "Integrated Terminal/Console", - "type": "python", - "request": "launch", - "stopOnEntry": true, - "pythonPath": "^\"\\${config:python.pythonPath}\"", - "program": "^\"\\${file}\"", - "cwd": "", - "console": "integratedTerminal", - "env": {}, - "envFile": "^\"\\${workspaceRoot}/.env\"", - "debugOptions": [ - "WaitOnAbnormalExit", - "WaitOnNormalExit" - ] - } - }, - { - "label": "%python.snippet.launch.externalTerminal.label%", - "description": "%python.snippet.launch.externalTerminal.description%", - "body": { - "name": "External Terminal/Console", - "type": "python", - "request": "launch", - "stopOnEntry": true, - "pythonPath": "^\"\\${config:python.pythonPath}\"", - "program": "^\"\\${file}\"", - "cwd": "", - "console": "externalTerminal", - "env": {}, - "envFile": "^\"\\${workspaceRoot}/.env\"", - "debugOptions": [ - "WaitOnAbnormalExit", - "WaitOnNormalExit" - ] - } - }, - { - "label": "%python.snippet.launch.django.label%", - "description": "%python.snippet.launch.django.description%", - "body": { - "name": "Django", - "type": "python", - "request": "launch", - "stopOnEntry": true, - "pythonPath": "^\"\\${config:python.pythonPath}\"", - "program": "^\"\\${workspaceRoot}/manage.py\"", - "cwd": "^\"\\${workspaceRoot}\"", - "args": [ - "runserver", - "--noreload", - "--nothreading" - ], - "env": {}, - "envFile": "^\"\\${workspaceRoot}/.env\"", - "debugOptions": [ - "WaitOnAbnormalExit", - "WaitOnNormalExit", - "RedirectOutput", - "DjangoDebugging" - ] - } - }, - { - "label": "%python.snippet.launch.flask.label%", - "description": "%python.snippet.launch.flask.description%", - "body": { - "name": "Flask", - "type": "python", - "request": "launch", - "stopOnEntry": false, - "pythonPath": "^\"\\${config:python.pythonPath}\"", - "program": "fully qualified path fo 'flask' executable. Generally located along with python interpreter", - "cwd": "^\"\\${workspaceRoot}\"", - "env": { - "FLASK_APP": "^\"\\${workspaceRoot}/quickstart/app.py\"" - }, - "args": [ - "run", - "--no-debugger", - "--no-reload" - ], - "envFile": "^\"\\${workspaceRoot}/.env\"", - "debugOptions": [ - "WaitOnAbnormalExit", - "WaitOnNormalExit", - "RedirectOutput" - ] - } - }, - { - "label": "%python.snippet.launch.flaskOld.label%", - "description": "%python.snippet.launch.flaskOld.description%", - "body": { - "name": "Flask (old)", - "type": "python", - "request": "launch", - "stopOnEntry": false, - "pythonPath": "^\"\\${config:python.pythonPath}\"", - "program": "^\"\\${workspaceRoot}/run.py\"", - "cwd": "^\"\\${workspaceRoot}\"", - "args": [], - "env": {}, - "envFile": "^\"\\${workspaceRoot}/.env\"", - "debugOptions": [ - "WaitOnAbnormalExit", - "WaitOnNormalExit", - "RedirectOutput" - ] - } - }, - { - "label": "%python.snippet.launch.pyramid.label%", - "description": "%python.snippet.launch.pyramid.description%", - "body": { - "name": "Pyramid", - "type": "python", - "request": "launch", - "stopOnEntry": true, - "pythonPath": "^\"\\${config:python.pythonPath}\"", - "cwd": "^\"\\${workspaceRoot}\"", - "env": {}, - "envFile": "^\"\\${workspaceRoot}/.env\"", - "args": [ - "^\"\\${workspaceRoot}/development.ini\"" - ], - "debugOptions": [ - "WaitOnAbnormalExit", - "WaitOnNormalExit", - "RedirectOutput", - "Pyramid" - ] - } - }, - { - "label": "%python.snippet.launch.watson.label%", - "description": "%python.snippet.launch.watson.description%", - "body": { - "name": "Watson", - "type": "python", - "request": "launch", - "stopOnEntry": true, - "pythonPath": "^\"\\${config:python.pythonPath}\"", - "program": "^\"\\${workspaceRoot}/console.py\"", - "cwd": "^\"\\${workspaceRoot}\"", - "args": [ - "dev", - "runserver", - "--noreload=True" - ], - "env": {}, - "envFile": "^\"\\${workspaceRoot}/.env\"", - "debugOptions": [ - "WaitOnAbnormalExit", - "WaitOnNormalExit", - "RedirectOutput" - ] - } - }, - { - "label": "%python.snippet.launch.scrapy.label%", - "description": "%python.snippet.launch.scrapy.description%", - "body": { - "name": "Scrapy", - "type": "python", - "request": "launch", - "stopOnEntry": true, - "pythonPath": "^\"\\${config:python.pythonPath}\"", - "program": "~/.virtualenvs/scrapy/bin/scrapy", - "cwd": "^\"\\${workspaceRoot}\"", - "args": [ - "crawl", - "specs", - "-o", - "bikes.json" - ], - "console": "integratedTerminal", - "env": {}, - "envFile": "^\"\\${workspaceRoot}/.env\"", - "debugOptions": [ - "WaitOnAbnormalExit", - "WaitOnNormalExit" - ] - } - }, - { - "label": "%python.snippet.launch.attach.label%", - "description": "%python.snippet.launch.attach.description%", - "body": { - "name": "Attach (Remote Debug)", - "type": "python", - "request": "attach", - "localRoot": "^\"\\${workspaceRoot}\"", - "remoteRoot": "^\"\\${workspaceRoot}\"", - "port": 3000, - "secret": "my_secret", - "host": "localhost" - } - } - ], - "configurationAttributes": { - "launch": { - "required": [ - "program" - ], - "properties": { - "module": { - "type": "string", - "description": "Name of the module to be debugged.", - "default": "" - }, - "program": { - "type": "string", - "description": "Absolute path to the program.", - "default": "${file}" - }, - "pythonPath": { - "type": "string", - "description": "Path (fully qualified) to python executable. Defaults to the value in settings.json", - "default": "${config:python.pythonPath}" - }, - "args": { - "type": "array", - "description": "Command line arguments passed to the program", - "default": [], - "items": { - "type": "string" - } - }, - "stopOnEntry": { - "type": "boolean", - "description": "Automatically stop after launch.", - "default": true - }, - "externalConsole": { - "type": "boolean", - "description": "Deprecated: use 'console' attribute instead.", - "default": false - }, - "console": { - "enum": [ - "none", - "integratedTerminal", - "externalTerminal" - ], - "description": "Where to launch the debug target: internal console, integrated terminal, or external terminal.", - "default": "none" - }, - "cwd": { - "type": "string", - "description": "Absolute path to the working directory of the program being debugged. Default is the root directory of the file (leave empty).", - "default": "" - }, - "debugOptions": { - "type": "array", - "description": "Advanced options, view read me for further details.", - "items": { - "type": "string", - "enum": [ - "WaitOnAbnormalExit", - "WaitOnNormalExit", - "RedirectOutput", - "DebugStdLib", - "BreakOnSystemExitZero", - "DjangoDebugging", - "Sudo", - "IgnoreDjangoTemplateWarnings", - "Pyramid" - ] - }, - "default": [ - "WaitOnAbnormalExit", - "WaitOnNormalExit", - "RedirectOutput" - ] - }, - "exceptionHandling": { - "description": "List of exception types and how they are handled during debugging (ignore, always break or break only if unhandled).", - "properties": { - "ignore": { - "type": "array", - "description": "Never break into these exceptions, e.g. 'copy.Error'", - "default": [], - "items": { - "type": "string" - } - }, - "always": { - "type": "array", - "description": "Always break into these exceptions, e.g. 'copy.Error'", - "default": [], - "items": { - "type": "string" - } - }, - "unhandled": { - "type": "array", - "description": "Break into these exceptions if they aren't handled, e.g. 'copy.Error'", - "default": [], - "items": { - "type": "string" - } - } - } - }, - "env": { - "type": "object", - "description": "Environment variables defined as a key value pair. Property ends up being the Environment Variable and the value of the property ends up being the value of the Env Variable.", - "default": {} - }, - "envFile": { - "type": "string", - "description": "Absolute path to a file containing environment variable definitions.", - "default": "" - } - } - }, - "attach": { - "required": [ - "localRoot", - "remoteRoot" - ], - "properties": { - "localRoot": { - "type": "string", - "description": "Local source root that corrresponds to the 'remoteRoot'.", - "default": "${workspaceRoot}" - }, - "remoteRoot": { - "type": "string", - "description": "The source root of the remote host.", - "default": "" - }, - "port": { - "type": "number", - "description": "Debug port to attach", - "default": 0 - }, - "host": { - "type": "string", - "description": "IP Address of the of remote server (default is localhost or use 127.0.0.1).", - "default": "localhost" - }, - "secret": { - "type": "string", - "description": "Secret used to authenticate for remote debugging.", - "default": "" - } - } - } - }, - "initialConfigurations": [{ - "name": "Python", - "type": "python", - "request": "launch", - "stopOnEntry": true, - "pythonPath": "${config:python.pythonPath}", - "program": "${file}", - "cwd": "${workspaceRoot}", - "env": {}, - "envFile": "${workspaceRoot}/.env", - "debugOptions": [ - "WaitOnAbnormalExit", - "WaitOnNormalExit", - "RedirectOutput" - ] - }, - { - "name": "PySpark", - "type": "python", - "request": "launch", - "stopOnEntry": true, - "osx": { - "pythonPath": "${env:SPARK_HOME}/bin/spark-submit" - }, - "windows": { - "pythonPath": "${env:SPARK_HOME}/bin/spark-submit.cmd" - }, - "linux": { - "pythonPath": "${env:SPARK_HOME}/bin/spark-submit" - }, - "program": "${file}", - "cwd": "${workspaceRoot}", - "env": {}, - "envFile": "${workspaceRoot}/.env", - "debugOptions": [ - "WaitOnAbnormalExit", - "WaitOnNormalExit", - "RedirectOutput" - ] - }, - { - "name": "Python Module", - "type": "python", - "request": "launch", - "stopOnEntry": true, - "pythonPath": "${config:python.pythonPath}", - "module": "module.name", - "cwd": "${workspaceRoot}", - "env": {}, - "envFile": "${workspaceRoot}/.env", - "debugOptions": [ - "WaitOnAbnormalExit", - "WaitOnNormalExit", - "RedirectOutput" - ] - }, - { - "name": "Integrated Terminal/Console", - "type": "python", - "request": "launch", - "stopOnEntry": true, - "pythonPath": "${config:python.pythonPath}", - "program": "${file}", - "cwd": "", - "console": "integratedTerminal", - "env": {}, - "envFile": "${workspaceRoot}/.env", - "debugOptions": [ - "WaitOnAbnormalExit", - "WaitOnNormalExit" - ] - }, - { - "name": "External Terminal/Console", - "type": "python", - "request": "launch", - "stopOnEntry": true, - "pythonPath": "${config:python.pythonPath}", - "program": "${file}", - "cwd": "", - "console": "externalTerminal", - "env": {}, - "envFile": "${workspaceRoot}/.env", - "debugOptions": [ - "WaitOnAbnormalExit", - "WaitOnNormalExit" - ] - }, - { - "name": "Django", - "type": "python", - "request": "launch", - "stopOnEntry": true, - "pythonPath": "${config:python.pythonPath}", - "program": "${workspaceRoot}/manage.py", - "cwd": "${workspaceRoot}", - "args": [ - "runserver", - "--noreload", - "--nothreading" - ], - "env": {}, - "envFile": "${workspaceRoot}/.env", - "debugOptions": [ - "WaitOnAbnormalExit", - "WaitOnNormalExit", - "RedirectOutput", - "DjangoDebugging" - ] - }, - { - "name": "Flask", - "type": "python", - "request": "launch", - "stopOnEntry": false, - "pythonPath": "${config:python.pythonPath}", - "program": "fully qualified path fo 'flask' executable. Generally located along with python interpreter", - "cwd": "${workspaceRoot}", - "env": { - "FLASK_APP": "${workspaceRoot}/quickstart/app.py" - }, - "args": [ - "run", - "--no-debugger", - "--no-reload" - ], - "envFile": "${workspaceRoot}/.env", - "debugOptions": [ - "WaitOnAbnormalExit", - "WaitOnNormalExit", - "RedirectOutput" - ] - }, - { - "name": "Flask (old)", - "type": "python", - "request": "launch", - "stopOnEntry": false, - "pythonPath": "${config:python.pythonPath}", - "program": "${workspaceRoot}/run.py", - "cwd": "${workspaceRoot}", - "args": [], - "env": {}, - "envFile": "${workspaceRoot}/.env", - "debugOptions": [ - "WaitOnAbnormalExit", - "WaitOnNormalExit", - "RedirectOutput" - ] - }, - { - "name": "Pyramid", - "type": "python", - "request": "launch", - "stopOnEntry": true, - "pythonPath": "${config:python.pythonPath}", - "cwd": "${workspaceRoot}", - "env": {}, - "envFile": "${workspaceRoot}/.env", - "args": [ - "${workspaceRoot}/development.ini" - ], - "debugOptions": [ - "WaitOnAbnormalExit", - "WaitOnNormalExit", - "RedirectOutput", - "Pyramid" - ] - }, - { - "name": "Watson", - "type": "python", - "request": "launch", - "stopOnEntry": true, - "pythonPath": "${config:python.pythonPath}", - "program": "${workspaceRoot}/console.py", - "cwd": "${workspaceRoot}", - "args": [ - "dev", - "runserver", - "--noreload=True" - ], - "env": {}, - "envFile": "${workspaceRoot}/.env", - "debugOptions": [ - "WaitOnAbnormalExit", - "WaitOnNormalExit", - "RedirectOutput" - ] - }, - { - "name": "Attach (Remote Debug)", - "type": "python", - "request": "attach", - "localRoot": "${workspaceRoot}", - "remoteRoot": "${workspaceRoot}", - "port": 3000, - "secret": "my_secret", - "host": "localhost" - } - ] - }], - "configuration": { - "type": "object", - "title": "Python Configuration", - "properties": { - "python.promptToInstallJupyter": { - "type": "boolean", - "default": true, - "description": "Display prompt to install Jupyter Extension." - }, - "python.pythonPath": { - "type": "string", - "default": "python", - "description": "Path to Python, you can use a custom version of Python by modifying this setting to include the full path." - }, - "python.venvPath": { - "type": "string", - "default": "", - "description": "Path to folder with a list of Virtual Environments (e.g. ~/.pyenv, ~/Envs, ~/.virtualenvs)." - }, - "python.envFile": { - "type": "string", - "description": "Absolute path to a file containing environment variable definitions.", - "default": "${workspaceRoot}/.env" - }, - "python.jediPath": { - "type": "string", - "default": "", - "description": "Path to directory containing the Jedi library (this path will contain the 'Jedi' sub directory)." - }, - "python.sortImports.path": { - "type": "string", - "description": "Path to isort script, default using inner version", - "default": "" - }, - "python.sortImports.args": { - "type": "array", - "description": "Arguments passed in. Each argument is a separate item in the array.", - "default": [], - "items": { - "type": "string" - } - }, - "python.linting.enabled": { - "type": "boolean", - "default": true, - "description": "Whether to lint Python files." - }, - "python.linting.enabledWithoutWorkspace": { - "type": "boolean", - "default": true, - "description": "Whether to lint Python files when no workspace is opened." - }, - "python.linting.prospectorEnabled": { - "type": "boolean", - "default": false, - "description": "Whether to lint Python files using prospector." - }, - "python.linting.pylintEnabled": { - "type": "boolean", - "default": true, - "description": "Whether to lint Python files using pylint." - }, - "python.linting.pep8Enabled": { - "type": "boolean", - "default": false, - "description": "Whether to lint Python files using pep8" - }, - "python.linting.flake8Enabled": { - "type": "boolean", - "default": false, - "description": "Whether to lint Python files using flake8" - }, - "python.linting.pydocstyleEnabled": { - "type": "boolean", - "default": false, - "description": "Whether to lint Python files using pydocstyle" - }, - "python.linting.mypyEnabled": { - "type": "boolean", - "default": false, - "description": "Whether to lint Python files using mypy." - }, - "python.linting.lintOnTextChange": { - "type": "boolean", - "default": true, - "description": "Whether to lint Python files when modified." - }, - "python.linting.lintOnSave": { - "type": "boolean", - "default": true, - "description": "Whether to lint Python files when saved." - }, - "python.linting.maxNumberOfProblems": { - "type": "number", - "default": 100, - "description": "Controls the maximum number of problems produced by the server." - }, - "python.linting.pylintCategorySeverity.convention": { - "type": "string", - "default": "Information", - "description": "Severity of Pylint message type 'Convention/C'.", - "enum": [ - "Hint", - "Error", - "Information", - "Warning" - ] - }, - "python.linting.pylintCategorySeverity.refactor": { - "type": "string", - "default": "Hint", - "description": "Severity of Pylint message type 'Refactor/R'.", - "enum": [ - "Hint", - "Error", - "Information", - "Warning" - ] - }, - "python.linting.pylintCategorySeverity.warning": { - "type": "string", - "default": "Warning", - "description": "Severity of Pylint message type 'Warning/W'.", - "enum": [ - "Hint", - "Error", - "Information", - "Warning" - ] - }, - "python.linting.pylintCategorySeverity.error": { - "type": "string", - "default": "Error", - "description": "Severity of Pylint message type 'Error/E'.", - "enum": [ - "Hint", - "Error", - "Information", - "Warning" - ] - }, - "python.linting.pylintCategorySeverity.fatal": { - "type": "string", - "default": "Error", - "description": "Severity of Pylint message type 'Fatal/F'.", - "enum": [ - "Hint", - "Error", - "Information", - "Warning" - ] - }, - "python.linting.pep8CategorySeverity.W": { - "type": "string", - "default": "Warning", - "description": "Severity of Pep8 message type 'W'.", - "enum": [ - "Hint", - "Error", - "Information", - "Warning" - ] - }, - "python.linting.pep8CategorySeverity.E": { - "type": "string", - "default": "Error", - "description": "Severity of Pep8 message type 'E'.", - "enum": [ - "Hint", - "Error", - "Information", - "Warning" - ] - }, - "python.linting.flake8CategorySeverity.F": { - "type": "string", - "default": "Error", - "description": "Severity of Flake8 message type 'F'.", - "enum": [ - "Hint", - "Error", - "Information", - "Warning" - ] - }, - "python.linting.flake8CategorySeverity.E": { - "type": "string", - "default": "Error", - "description": "Severity of Flake8 message type 'E'.", - "enum": [ - "Hint", - "Error", - "Information", - "Warning" - ] - }, - "python.linting.flake8CategorySeverity.W": { - "type": "string", - "default": "Warning", - "description": "Severity of Flake8 message type 'W'.", - "enum": [ - "Hint", - "Error", - "Information", - "Warning" - ] - }, - "python.linting.mypyCategorySeverity.error": { - "type": "string", - "default": "Error", - "description": "Severity of Mypy message type 'Error'.", - "enum": [ - "Hint", - "Error", - "Information", - "Warning" - ] - }, - "python.linting.mypyCategorySeverity.note": { - "type": "string", - "default": "Information", - "description": "Severity of Mypy message type 'Note'.", - "enum": [ - "Hint", - "Error", - "Information", - "Warning" - ] - }, - "python.linting.prospectorPath": { - "type": "string", - "default": "prospector", - "description": "Path to Prospector, you can use a custom version of prospector by modifying this setting to include the full path." - }, - "python.linting.pylintPath": { - "type": "string", - "default": "pylint", - "description": "Path to Pylint, you can use a custom version of pylint by modifying this setting to include the full path." - }, - "python.linting.pep8Path": { - "type": "string", - "default": "pep8", - "description": "Path to pep8, you can use a custom version of pep8 by modifying this setting to include the full path." - }, - "python.linting.flake8Path": { - "type": "string", - "default": "flake8", - "description": "Path to flake8, you can use a custom version of flake8 by modifying this setting to include the full path." - }, - "python.linting.pydocstylePath": { - "type": "string", - "default": "pydocstyle", - "description": "Path to pydocstyle, you can use a custom version of pydocstyle by modifying this setting to include the full path." - }, - "python.linting.mypyPath": { - "type": "string", - "default": "mypy", - "description": "Path to mypy, you can use a custom version of mypy by modifying this setting to include the full path." - }, - "python.linting.prospectorArgs": { - "type": "array", - "description": "Arguments passed in. Each argument is a separate item in the array.", - "default": [], - "items": { - "type": "string" - } - }, - "python.linting.pylintArgs": { - "type": "array", - "description": "Arguments passed in. Each argument is a separate item in the array.", - "default": [], - "items": { - "type": "string" - } - }, - "python.linting.pep8Args": { - "type": "array", - "description": "Arguments passed in. Each argument is a separate item in the array.", - "default": [], - "items": { - "type": "string" - } - }, - "python.linting.flake8Args": { - "type": "array", - "description": "Arguments passed in. Each argument is a separate item in the array.", - "default": [], - "items": { - "type": "string" - } - }, - "python.linting.pydocstyleArgs": { - "type": "array", - "description": "Arguments passed in. Each argument is a separate item in the array.", - "default": [], - "items": { - "type": "string" - } - }, - "python.linting.mypyArgs": { - "type": "array", - "description": "Arguments passed in. Each argument is a separate item in the array.", - "default": [ - "--ignore-missing-imports", - "--follow-imports=silent" - ], - "items": { - "type": "string" - } - }, - "python.linting.outputWindow": { - "type": "string", - "default": "Python", - "description": "The output window name for the linting messages, defaults to Python output window." - }, - "python.formatting.provider": { - "type": "string", - "default": "autopep8", - "description": "Provider for formatting. Possible options include 'autopep8' and 'yapf'.", - "enum": [ - "autopep8", - "yapf", - "none" - ] - }, - "python.formatting.autopep8Path": { - "type": "string", - "default": "autopep8", - "description": "Path to autopep8, you can use a custom version of autopep8 by modifying this setting to include the full path." - }, - "python.formatting.yapfPath": { - "type": "string", - "default": "yapf", - "description": "Path to yapf, you can use a custom version of yapf by modifying this setting to include the full path." - }, - "python.formatting.autopep8Args": { - "type": "array", - "description": "Arguments passed in. Each argument is a separate item in the array.", - "default": [], - "items": { - "type": "string" - } - }, - "python.formatting.yapfArgs": { - "type": "array", - "description": "Arguments passed in. Each argument is a separate item in the array.", - "default": [], - "items": { - "type": "string" - } - }, - "python.formatting.formatOnSave": { - "type": "boolean", - "default": false, - "description": "Format the document upon saving." - }, - "python.formatting.outputWindow": { - "type": "string", - "default": "Python", - "description": "The output window name for the formatting messages, defaults to Python output window." - }, - "python.autoComplete.preloadModules": { - "type": "array", - "items": { - "type": "string" - }, - "default": [], - "description": "Comma delimited list of modules preloaded to speed up Auto Complete (e.g. add Numpy, Pandas, etc, items slow to load when autocompleting)." - }, - "python.autoComplete.extraPaths": { - "type": "array", - "default": [], - "description": "List of paths to libraries and the like that need to be imported by auto complete engine. E.g. when using Google App SDK, the paths are not in system path, hence need to be added into this list." - }, - "python.autoComplete.addBrackets": { - "type": "boolean", - "default": false, - "description": "Automatically add brackets for functions." - }, - "python.workspaceSymbols.tagFilePath": { - "type": "string", - "default": "${workspaceRoot}/.vscode/tags", - "description": "Fully qualified path to tag file (exuberant ctag file), used to provide workspace symbols." - }, - "python.workspaceSymbols.enabled": { - "type": "boolean", - "default": true, - "description": "Set to 'false' to disable Workspace Symbol provider using ctags." - }, - "python.workspaceSymbols.rebuildOnStart": { - "type": "boolean", - "default": true, - "description": "Whether to re-build the tags file on start (defaults to true)." - }, - "python.workspaceSymbols.rebuildOnFileSave": { - "type": "boolean", - "default": true, - "description": "Whether to re-build the tags file on when changes made to python files are saved." - }, - "python.workspaceSymbols.ctagsPath": { - "type": "string", - "default": "ctags", - "description": "Fully qualilified path to the ctags executable (else leave as ctags, assuming it is in current path)." - }, - "python.workspaceSymbols.exclusionPatterns": { - "type": "array", - "default": [ - "**/site-packages/**" - ], - "items": { - "type": "string" - }, - "description": "Pattern used to exclude files and folders from ctags See http://ctags.sourceforge.net/ctags.html." - }, - "python.unitTest.promptToConfigure": { - "type": "boolean", - "default": true, - "description": "Where to prompt to configure a test framework if potential tests directories are discovered." - }, - "python.unitTest.debugPort": { - "type": "number", - "default": 3000, - "description": "Port number used for debugging of unittests." - }, - "python.unitTest.nosetestsEnabled": { - "type": "boolean", - "default": false, - "description": "Whether to enable or disable unit testing using nosetests." - }, - "python.unitTest.nosetestPath": { - "type": "string", - "default": "nosetests", - "description": "Path to nosetests, you can use a custom version of nosetests by modifying this setting to include the full path." - }, - "python.unitTest.pyTestEnabled": { - "type": "boolean", - "default": false, - "description": "Whether to enable or disable unit testing using pytest." - }, - "python.unitTest.pyTestPath": { - "type": "string", - "default": "py.test", - "description": "Path to pytest (py.test), you can use a custom version of pytest by modifying this setting to include the full path." - }, - "python.unitTest.nosetestArgs": { - "type": "array", - "description": "Arguments passed in. Each argument is a separate item in the array.", - "default": [], - "items": { - "type": "string" - } - }, - "python.unitTest.pyTestArgs": { - "type": "array", - "description": "Arguments passed in. Each argument is a separate item in the array.", - "default": [], - "items": { - "type": "string" - } - }, - "python.unitTest.unittestEnabled": { - "type": "boolean", - "default": false, - "description": "Whether to enable or disable unit testing using unittest." - }, - "python.unitTest.unittestArgs": { - "type": "array", - "description": "Arguments passed in. Each argument is a separate item in the array.", - "default": [ - "-v", - "-s", - ".", - "-p", - "*test*.py" - ], - "items": { - "type": "string" - } - }, - "python.linting.ignorePatterns": { - "type": "array", - "description": "Patterns used to exclude files or folders from being linted.", - "default": [ - ".vscode/*.py", - "**/site-packages/**/*.py" - ], - "items": { - "type": "string" - } - }, - "python.linting.pylamaEnabled": { - "type": "boolean", - "default": false, - "description": "Whether to lint Python files using pylama." - }, - "python.linting.pylamaPath": { - "type": "string", - "default": "pylama", - "description": "Path to pylama, you can use a custom version of pylama by modifying this setting to include the full path." - }, - "python.linting.pylamaArgs": { - "type": "array", - "description": "Arguments passed in. Each argument is a separate item in the array.", - "default": [], - "items": { - "type": "string" - } - }, - "python.unitTest.outputWindow": { - "type": "string", - "default": "Python Test Log", - "description": "The output window name for the unit test messages, defaults to Python output window." - }, - "python.terminal.executeInFileDir": { - "type": "boolean", - "default": false, - "description": "When executing a file in the terminal, whether to use execute in the file's directory, instead of the current open folder." - }, - "python.terminal.launchArgs": { - "type": "array", - "default": [], - "description": "Python launch arguments to use when executing a file in the terminal." - }, - "python.jupyter.appendResults": { - "type": "boolean", - "default": true, - "description": "Whether to appen the results to results window, else clear and display." - }, - "python.jupyter.defaultKernel": { - "type": "string", - "default": "", - "description": "Default kernel to be used. By default the first available kernel is used." - }, - "python.jupyter.startupCode": { - "type": "array", - "items": { - "type": "string" - }, - "default": [ - "%matplotlib inline" - ], - "description": "Code executed when the kernel starts. Such as the default of '%matplotlib inline'. Individual lines can be placed in separate items of the array." - } - } - } - }, - "scripts": { - "vscode:prepublish": "tsc -p ./ && webpack", - "compile": "webpack && tsc -watch -p ./", - "postinstall": "node ./node_modules/vscode/bin/install", - "test": "node ./node_modules/vscode/bin/test" - }, - "dependencies": { - "anser": "^1.1.0", - "copy-paste": "^1.3.0", - "diff-match-patch": "^1.0.0", - "fs-extra": "^0.30.0", - "fuzzy": "^0.1.3", - "line-by-line": "^0.1.5", - "minimatch": "^3.0.3", - "named-js-regexp": "^1.3.1", - "node-static": "^0.7.9", - "prepend-file": "^1.3.0", - "rx": "^4.1.0", - "socket.io": "^1.4.8", - "tmp": "0.0.29", - "transformime": "^3.1.2", - "transformime-marked": "0.0.1", - "tree-kill": "^1.1.0", - "uint64be": "^1.0.1", - "untildify": "^3.0.2", - "vscode-debugadapter": "^1.0.1", - "vscode-debugprotocol": "^1.0.1", - "vscode-extension-telemetry": "0.0.5", - "vscode-languageclient": "^1.1.0", - "vscode-languageserver": "^1.1.0", - "xml2js": "^0.4.17" - }, - "devDependencies": { - "@types/jquery": "^1.10.31", - "@types/mocha": "^2.2.32", - "@types/node": "^6.0.40", - "@types/rx": "^2.5.33", - "@types/socket.io": "^1.4.27", - "@types/socket.io-client": "^1.4.27", - "@types/uuid": "^3.3.27", - "@types/sinon": "^2.3.2", - "babel-core": "^6.14.0", - "babel-loader": "^6.2.5", - "babel-preset-es2015": "^6.14.0", - "ignore-loader": "^0.1.1", - "mocha": "^2.3.3", - "sinon": "^2.3.6", - "retyped-diff-match-patch-tsd-ambient": "^1.0.0-0", - "ts-loader": "^0.8.2", - "tslint": "^3.15.1", - "typescript": "^2.3.2", - "vscode": "^1.0.3", - "webpack": "^1.13.2" - } + "name": "python", + "displayName": "Python", + "description": "Linting, Debugging (multi-threaded, remote), Intellisense, code formatting, refactoring, unit tests, snippets, Data Science (with Jupyter), PySpark and more.", + "version": "0.7.0", + "publisher": "donjayamanne", + "author": { + "name": "Don Jayamanne", + "email": "don.jayamanne@yahoo.com" + }, + "license": "MIT", + "homepage": "http://donjayamanne.github.io/pythonVSCode/", + "repository": { + "type": "git", + "url": "https://github.com/DonJayamanne/pythonVSCode" + }, + "bugs": { + "url": "https://github.com/DonJayamanne/pythonVSCode/issues" + }, + "icon": "icon.png", + "galleryBanner": { + "color": "#1e415e", + "theme": "dark" + }, + "engines": { + "vscode": "^1.9.0" + }, + "recommendations": [ + "donjayamanne.jupyter" + ], + "keywords": [ + "python", + "jupyter", + "django", + "debugger", + "unittest" + ], + "categories": [ + "Languages", + "Debuggers", + "Linters", + "Snippets", + "Formatters", + "Other" + ], + "activationEvents": [ + "onLanguage:python", + "onCommand:python.python-debug.startSession", + "onCommand:python.execInTerminal", + "onCommand:python.sortImports", + "onCommand:python.runtests", + "onCommand:python.debugtests", + "onCommand:python.setInterpreter", + "onCommand:python.viewTestUI", + "onCommand:python.viewTestOutput", + "onCommand:python.selectAndRunTestMethod", + "onCommand:python.selectAndDebugTestMethod", + "onCommand:python.selectAndRunTestFile", + "onCommand:python.runCurrentTestFile", + "onCommand:python.runFailedTests", + "onCommand:python.execSelectionInTerminal", + "onCommand:python.execSelectionInDjangoShell", + "onCommand:jupyter.runSelectionLine", + "onCommand:jupyter.execCurrentCell", + "onCommand:jupyter.execCurrentCellAndAdvance", + "onCommand:python.displayHelp", + "onCommand:python.buildWorkspaceSymbols", + "onCommand:python.updateSparkLibrary", + "onCommand:python.startREPL", + "onCommand:python.goToPythonObject" + ], + "main": "./out/client/extension", + "contributes": { + "snippets": [ + { + "language": "python", + "path": "./snippets/python.json" + } + ], + "keybindings": [ + { + "command": "jupyter.runSelectionLine", + "key": "ctrl+alt+enter", + "when": "editorFocus && !replaceActive && !searchViewletVisible && !findWidgetVisible" + } + ], + "commands": [ + { + "command": "python.sortImports", + "title": "Sort Imports", + "category": "Python Refactor" + }, + { + "command": "python.startREPL", + "title": "Start REPL", + "category": "Python" + }, + { + "command": "python.buildWorkspaceSymbols", + "title": "Build Workspace Symbols", + "category": "Python" + }, + { + "command": "python.runtests", + "title": "Run All Unit Tests", + "category": "Python" + }, + { + "command": "python.debugtests", + "title": "Debug All Unit Tests", + "category": "Python" + }, + { + "command": "python.execInTerminal", + "title": "Run Python File in Terminal", + "category": "Python" + }, + { + "command": "python.setInterpreter", + "title": "Select Workspace Interpreter", + "category": "Python" + }, + { + "command": "python.updateSparkLibrary", + "title": "Update Workspace PySpark Libraries", + "category": "Python" + }, + { + "command": "python.refactorExtractVariable", + "title": "Extract Variable", + "category": "Python Refactor" + }, + { + "command": "python.refactorExtractMethod", + "title": "Extract Method", + "category": "Python Refactor" + }, + { + "command": "python.viewTestOutput", + "title": "Show Unit Test Output", + "category": "Python" + }, + { + "command": "python.selectAndRunTestMethod", + "title": "Run Unit Test Method ...", + "category": "Python" + }, + { + "command": "python.selectAndDebugTestMethod", + "title": "Debug Unit Test Method ...", + "category": "Python" + }, + { + "command": "python.selectAndRunTestFile", + "title": "Run Unit Test File ...", + "category": "Python" + }, + { + "command": "python.runCurrentTestFile", + "title": "Run Current Unit Test File", + "category": "Python" + }, + { + "command": "python.runFailedTests", + "title": "Run Failed Unit Tests", + "category": "Python" + }, + { + "command": "python.execSelectionInTerminal", + "title": "Run Selection/Line in Python Terminal", + "category": "Python" + }, + { + "command": "python.execSelectionInDjangoShell", + "title": "Run Selection/Line in Django Shell", + "category": "Python" + }, + { + "command": "jupyter.runSelectionLine", + "title": "Run Selection/Line", + "category": "Jupyter" + }, + { + "command": "jupyter.execCurrentCell", + "title": "Run Cell", + "category": "Jupyter" + }, + { + "command": "jupyter.execCurrentCellAndAdvance", + "title": "Run Cell and Advance", + "category": "Jupyter" + }, + { + "command": "jupyter.gotToPreviousCell", + "title": "Go to Previous Cell", + "category": "Jupyter" + }, + { + "command": "jupyter.gotToNextCell", + "title": "Go to Next Cell", + "category": "Jupyter" + }, + { + "command": "python.displayHelp", + "title": "Help", + "category": "Python" + }, + { + "command": "python.goToPythonObject", + "title": "Go to Python Object", + "category": "Python" + } + ], + "menus": { + "editor/context": [ + { + "command": "python.refactorExtractVariable", + "title": "Refactor: Extract Variable", + "group": "Refactor", + "when": "editorHasSelection && editorLangId == python" + }, + { + "command": "python.refactorExtractMethod", + "title": "Refactor: Extract Method", + "group": "Refactor", + "when": "editorHasSelection && editorLangId == python" + }, + { + "command": "python.sortImports", + "title": "Refactor: Sort Imports", + "group": "Refactor", + "when": "editorLangId == python" + }, + { + "command": "python.execSelectionInTerminal", + "group": "Python", + "when": "editorHasSelection && editorLangId == python" + }, + { + "command": "python.execSelectionInDjangoShell", + "group": "Python", + "when": "editorHasSelection && editorLangId == python && python.isDjangoProject" + }, + { + "when": "resourceLangId == python", + "command": "python.execInTerminal", + "group": "Python" + }, + { + "when": "resourceLangId == python", + "command": "python.runCurrentTestFile", + "group": "Python" + } + ], + "explorer/context": [ + { + "when": "resourceLangId == python", + "command": "python.runtests", + "group": "Python" + }, + { + "when": "resourceLangId == python", + "command": "python.debugtests", + "group": "Python" + }, + { + "when": "resourceLangId == python", + "command": "python.execInTerminal", + "group": "Python" + } + ] + }, + "debuggers": [ + { + "type": "python", + "label": "Python", + "languages": [ + "python" + ], + "startSessionCommand": "python.python-debug.startSession", + "enableBreakpointsFor": { + "languageIds": [ + "python", + "html" + ] + }, + "aiKey": "fce7a3d5-4665-4404-b786-31a6306749a6", + "program": "./out/client/debugger/Main.js", + "runtime": "node", + "configurationSnippets": [ + { + "label": "%python.snippet.launch.standard.label%", + "description": "%python.snippet.launch.standard.description%", + "body": { + "name": "Python", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "pythonPath": "^\"\\${config:python.pythonPath}\"", + "program": "^\"\\${file}\"", + "cwd": "^\"\\${workspaceRoot}\"", + "env": {}, + "envFile": "^\"\\${workspaceRoot}/.env\"", + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput" + ] + } + }, + { + "label": "%python.snippet.launch.pyspark.label%", + "description": "%python.snippet.launch.pyspark.description%", + "body": { + "name": "PySpark", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "osx": { + "pythonPath": "^\"\\${env:SPARK_HOME}/bin/spark-submit\"" + }, + "windows": { + "pythonPath": "^\"\\${env:SPARK_HOME}/bin/spark-submit.cmd\"" + }, + "linux": { + "pythonPath": "^\"\\${env:SPARK_HOME}/bin/spark-submit\"" + }, + "program": "^\"\\${file}\"", + "cwd": "^\"\\${workspaceRoot}\"", + "env": {}, + "envFile": "^\"\\${workspaceRoot}/.env\"", + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput" + ] + } + }, + { + "label": "%python.snippet.launch.module.label%", + "description": "%python.snippet.launch.module.description%", + "body": { + "name": "Python Module", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "pythonPath": "^\"\\${config:python.pythonPath}\"", + "module": "module.name", + "cwd": "^\"\\${workspaceRoot}\"", + "env": {}, + "envFile": "^\"\\${workspaceRoot}/.env\"", + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput" + ] + } + }, + { + "label": "%python.snippet.launch.terminal.label%", + "description": "%python.snippet.launch.terminal.description%", + "body": { + "name": "Integrated Terminal/Console", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "pythonPath": "^\"\\${config:python.pythonPath}\"", + "program": "^\"\\${file}\"", + "cwd": "", + "console": "integratedTerminal", + "env": {}, + "envFile": "^\"\\${workspaceRoot}/.env\"", + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit" + ] + } + }, + { + "label": "%python.snippet.launch.externalTerminal.label%", + "description": "%python.snippet.launch.externalTerminal.description%", + "body": { + "name": "External Terminal/Console", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "pythonPath": "^\"\\${config:python.pythonPath}\"", + "program": "^\"\\${file}\"", + "cwd": "", + "console": "externalTerminal", + "env": {}, + "envFile": "^\"\\${workspaceRoot}/.env\"", + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit" + ] + } + }, + { + "label": "%python.snippet.launch.django.label%", + "description": "%python.snippet.launch.django.description%", + "body": { + "name": "Django", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "pythonPath": "^\"\\${config:python.pythonPath}\"", + "program": "^\"\\${workspaceRoot}/manage.py\"", + "cwd": "^\"\\${workspaceRoot}\"", + "args": [ + "runserver", + "--noreload", + "--nothreading" + ], + "env": {}, + "envFile": "^\"\\${workspaceRoot}/.env\"", + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput", + "DjangoDebugging" + ] + } + }, + { + "label": "%python.snippet.launch.flask.label%", + "description": "%python.snippet.launch.flask.description%", + "body": { + "name": "Flask", + "type": "python", + "request": "launch", + "stopOnEntry": false, + "pythonPath": "^\"\\${config:python.pythonPath}\"", + "program": "fully qualified path fo 'flask' executable. Generally located along with python interpreter", + "cwd": "^\"\\${workspaceRoot}\"", + "env": { + "FLASK_APP": "^\"\\${workspaceRoot}/quickstart/app.py\"" + }, + "args": [ + "run", + "--no-debugger", + "--no-reload" + ], + "envFile": "^\"\\${workspaceRoot}/.env\"", + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput" + ] + } + }, + { + "label": "%python.snippet.launch.flaskOld.label%", + "description": "%python.snippet.launch.flaskOld.description%", + "body": { + "name": "Flask (old)", + "type": "python", + "request": "launch", + "stopOnEntry": false, + "pythonPath": "^\"\\${config:python.pythonPath}\"", + "program": "^\"\\${workspaceRoot}/run.py\"", + "cwd": "^\"\\${workspaceRoot}\"", + "args": [], + "env": {}, + "envFile": "^\"\\${workspaceRoot}/.env\"", + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput" + ] + } + }, + { + "label": "%python.snippet.launch.pyramid.label%", + "description": "%python.snippet.launch.pyramid.description%", + "body": { + "name": "Pyramid", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "pythonPath": "^\"\\${config:python.pythonPath}\"", + "cwd": "^\"\\${workspaceRoot}\"", + "env": {}, + "envFile": "^\"\\${workspaceRoot}/.env\"", + "args": [ + "^\"\\${workspaceRoot}/development.ini\"" + ], + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput", + "Pyramid" + ] + } + }, + { + "label": "%python.snippet.launch.watson.label%", + "description": "%python.snippet.launch.watson.description%", + "body": { + "name": "Watson", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "pythonPath": "^\"\\${config:python.pythonPath}\"", + "program": "^\"\\${workspaceRoot}/console.py\"", + "cwd": "^\"\\${workspaceRoot}\"", + "args": [ + "dev", + "runserver", + "--noreload=True" + ], + "env": {}, + "envFile": "^\"\\${workspaceRoot}/.env\"", + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput" + ] + } + }, + { + "label": "%python.snippet.launch.scrapy.label%", + "description": "%python.snippet.launch.scrapy.description%", + "body": { + "name": "Scrapy", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "pythonPath": "^\"\\${config:python.pythonPath}\"", + "program": "~/.virtualenvs/scrapy/bin/scrapy", + "cwd": "^\"\\${workspaceRoot}\"", + "args": [ + "crawl", + "specs", + "-o", + "bikes.json" + ], + "console": "integratedTerminal", + "env": {}, + "envFile": "^\"\\${workspaceRoot}/.env\"", + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit" + ] + } + }, + { + "label": "%python.snippet.launch.attach.label%", + "description": "%python.snippet.launch.attach.description%", + "body": { + "name": "Attach (Remote Debug)", + "type": "python", + "request": "attach", + "localRoot": "^\"\\${workspaceRoot}\"", + "remoteRoot": "^\"\\${workspaceRoot}\"", + "port": 3000, + "secret": "my_secret", + "host": "localhost" + } + } + ], + "configurationAttributes": { + "launch": { + "required": [ + "program" + ], + "properties": { + "module": { + "type": "string", + "description": "Name of the module to be debugged.", + "default": "" + }, + "program": { + "type": "string", + "description": "Absolute path to the program.", + "default": "${file}" + }, + "pythonPath": { + "type": "string", + "description": "Path (fully qualified) to python executable. Defaults to the value in settings.json", + "default": "${config:python.pythonPath}" + }, + "args": { + "type": "array", + "description": "Command line arguments passed to the program", + "default": [], + "items": { + "type": "string" + } + }, + "stopOnEntry": { + "type": "boolean", + "description": "Automatically stop after launch.", + "default": true + }, + "externalConsole": { + "type": "boolean", + "description": "Deprecated: use 'console' attribute instead.", + "default": false + }, + "console": { + "enum": [ + "none", + "integratedTerminal", + "externalTerminal" + ], + "description": "Where to launch the debug target: internal console, integrated terminal, or external terminal.", + "default": "none" + }, + "cwd": { + "type": "string", + "description": "Absolute path to the working directory of the program being debugged. Default is the root directory of the file (leave empty).", + "default": "" + }, + "debugOptions": { + "type": "array", + "description": "Advanced options, view read me for further details.", + "items": { + "type": "string", + "enum": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput", + "DebugStdLib", + "BreakOnSystemExitZero", + "DjangoDebugging", + "Sudo", + "IgnoreDjangoTemplateWarnings", + "Pyramid" + ] + }, + "default": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput" + ] + }, + "exceptionHandling": { + "description": "List of exception types and how they are handled during debugging (ignore, always break or break only if unhandled).", + "properties": { + "ignore": { + "type": "array", + "description": "Never break into these exceptions, e.g. 'copy.Error'", + "default": [], + "items": { + "type": "string" + } + }, + "always": { + "type": "array", + "description": "Always break into these exceptions, e.g. 'copy.Error'", + "default": [], + "items": { + "type": "string" + } + }, + "unhandled": { + "type": "array", + "description": "Break into these exceptions if they aren't handled, e.g. 'copy.Error'", + "default": [], + "items": { + "type": "string" + } + } + } + }, + "env": { + "type": "object", + "description": "Environment variables defined as a key value pair. Property ends up being the Environment Variable and the value of the property ends up being the value of the Env Variable.", + "default": {} + }, + "envFile": { + "type": "string", + "description": "Absolute path to a file containing environment variable definitions.", + "default": "" + } + } + }, + "attach": { + "required": [ + "localRoot", + "remoteRoot" + ], + "properties": { + "localRoot": { + "type": "string", + "description": "Local source root that corrresponds to the 'remoteRoot'.", + "default": "${workspaceRoot}" + }, + "remoteRoot": { + "type": "string", + "description": "The source root of the remote host.", + "default": "" + }, + "port": { + "type": "number", + "description": "Debug port to attach", + "default": 0 + }, + "host": { + "type": "string", + "description": "IP Address of the of remote server (default is localhost or use 127.0.0.1).", + "default": "localhost" + }, + "secret": { + "type": "string", + "description": "Secret used to authenticate for remote debugging.", + "default": "" + } + } + } + }, + "initialConfigurations": [ + { + "name": "Python", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "pythonPath": "${config:python.pythonPath}", + "program": "${file}", + "cwd": "${workspaceRoot}", + "env": {}, + "envFile": "${workspaceRoot}/.env", + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput" + ] + }, + { + "name": "PySpark", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "osx": { + "pythonPath": "${env:SPARK_HOME}/bin/spark-submit" + }, + "windows": { + "pythonPath": "${env:SPARK_HOME}/bin/spark-submit.cmd" + }, + "linux": { + "pythonPath": "${env:SPARK_HOME}/bin/spark-submit" + }, + "program": "${file}", + "cwd": "${workspaceRoot}", + "env": {}, + "envFile": "${workspaceRoot}/.env", + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput" + ] + }, + { + "name": "Python Module", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "pythonPath": "${config:python.pythonPath}", + "module": "module.name", + "cwd": "${workspaceRoot}", + "env": {}, + "envFile": "${workspaceRoot}/.env", + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput" + ] + }, + { + "name": "Integrated Terminal/Console", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "pythonPath": "${config:python.pythonPath}", + "program": "${file}", + "cwd": "", + "console": "integratedTerminal", + "env": {}, + "envFile": "${workspaceRoot}/.env", + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit" + ] + }, + { + "name": "External Terminal/Console", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "pythonPath": "${config:python.pythonPath}", + "program": "${file}", + "cwd": "", + "console": "externalTerminal", + "env": {}, + "envFile": "${workspaceRoot}/.env", + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit" + ] + }, + { + "name": "Django", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "pythonPath": "${config:python.pythonPath}", + "program": "${workspaceRoot}/manage.py", + "cwd": "${workspaceRoot}", + "args": [ + "runserver", + "--noreload", + "--nothreading" + ], + "env": {}, + "envFile": "${workspaceRoot}/.env", + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput", + "DjangoDebugging" + ] + }, + { + "name": "Flask", + "type": "python", + "request": "launch", + "stopOnEntry": false, + "pythonPath": "${config:python.pythonPath}", + "program": "fully qualified path fo 'flask' executable. Generally located along with python interpreter", + "cwd": "${workspaceRoot}", + "env": { + "FLASK_APP": "${workspaceRoot}/quickstart/app.py" + }, + "args": [ + "run", + "--no-debugger", + "--no-reload" + ], + "envFile": "${workspaceRoot}/.env", + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput" + ] + }, + { + "name": "Flask (old)", + "type": "python", + "request": "launch", + "stopOnEntry": false, + "pythonPath": "${config:python.pythonPath}", + "program": "${workspaceRoot}/run.py", + "cwd": "${workspaceRoot}", + "args": [], + "env": {}, + "envFile": "${workspaceRoot}/.env", + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput" + ] + }, + { + "name": "Pyramid", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "pythonPath": "${config:python.pythonPath}", + "cwd": "${workspaceRoot}", + "env": {}, + "envFile": "${workspaceRoot}/.env", + "args": [ + "${workspaceRoot}/development.ini" + ], + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput", + "Pyramid" + ] + }, + { + "name": "Watson", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "pythonPath": "${config:python.pythonPath}", + "program": "${workspaceRoot}/console.py", + "cwd": "${workspaceRoot}", + "args": [ + "dev", + "runserver", + "--noreload=True" + ], + "env": {}, + "envFile": "${workspaceRoot}/.env", + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput" + ] + }, + { + "name": "Attach (Remote Debug)", + "type": "python", + "request": "attach", + "localRoot": "${workspaceRoot}", + "remoteRoot": "${workspaceRoot}", + "port": 3000, + "secret": "my_secret", + "host": "localhost" + } + ] + } + ], + "configuration": { + "type": "object", + "title": "Python Configuration", + "properties": { + "python.promptToInstallJupyter": { + "type": "boolean", + "default": true, + "description": "Display prompt to install Jupyter Extension." + }, + "python.pythonPath": { + "type": "string", + "default": "python", + "description": "Path to Python, you can use a custom version of Python by modifying this setting to include the full path." + }, + "python.venvPath": { + "type": "string", + "default": "", + "description": "Path to folder with a list of Virtual Environments (e.g. ~/.pyenv, ~/Envs, ~/.virtualenvs)." + }, + "python.envFile": { + "type": "string", + "description": "Absolute path to a file containing environment variable definitions.", + "default": "${workspaceRoot}/.env" + }, + "python.jediPath": { + "type": "string", + "default": "", + "description": "Path to directory containing the Jedi library (this path will contain the 'Jedi' sub directory)." + }, + "python.sortImports.path": { + "type": "string", + "description": "Path to isort script, default using inner version", + "default": "" + }, + "python.sortImports.args": { + "type": "array", + "description": "Arguments passed in. Each argument is a separate item in the array.", + "default": [], + "items": { + "type": "string" + } + }, + "python.linting.enabled": { + "type": "boolean", + "default": true, + "description": "Whether to lint Python files." + }, + "python.linting.enabledWithoutWorkspace": { + "type": "boolean", + "default": true, + "description": "Whether to lint Python files when no workspace is opened." + }, + "python.linting.prospectorEnabled": { + "type": "boolean", + "default": false, + "description": "Whether to lint Python files using prospector." + }, + "python.linting.pylintEnabled": { + "type": "boolean", + "default": true, + "description": "Whether to lint Python files using pylint." + }, + "python.linting.pep8Enabled": { + "type": "boolean", + "default": false, + "description": "Whether to lint Python files using pep8" + }, + "python.linting.flake8Enabled": { + "type": "boolean", + "default": false, + "description": "Whether to lint Python files using flake8" + }, + "python.linting.pydocstyleEnabled": { + "type": "boolean", + "default": false, + "description": "Whether to lint Python files using pydocstyle" + }, + "python.linting.mypyEnabled": { + "type": "boolean", + "default": false, + "description": "Whether to lint Python files using mypy." + }, + "python.linting.lintOnTextChange": { + "type": "boolean", + "default": true, + "description": "Whether to lint Python files when modified." + }, + "python.linting.lintOnSave": { + "type": "boolean", + "default": true, + "description": "Whether to lint Python files when saved." + }, + "python.linting.maxNumberOfProblems": { + "type": "number", + "default": 100, + "description": "Controls the maximum number of problems produced by the server." + }, + "python.linting.pylintCategorySeverity.convention": { + "type": "string", + "default": "Information", + "description": "Severity of Pylint message type 'Convention/C'.", + "enum": [ + "Hint", + "Error", + "Information", + "Warning" + ] + }, + "python.linting.pylintCategorySeverity.refactor": { + "type": "string", + "default": "Hint", + "description": "Severity of Pylint message type 'Refactor/R'.", + "enum": [ + "Hint", + "Error", + "Information", + "Warning" + ] + }, + "python.linting.pylintCategorySeverity.warning": { + "type": "string", + "default": "Warning", + "description": "Severity of Pylint message type 'Warning/W'.", + "enum": [ + "Hint", + "Error", + "Information", + "Warning" + ] + }, + "python.linting.pylintCategorySeverity.error": { + "type": "string", + "default": "Error", + "description": "Severity of Pylint message type 'Error/E'.", + "enum": [ + "Hint", + "Error", + "Information", + "Warning" + ] + }, + "python.linting.pylintCategorySeverity.fatal": { + "type": "string", + "default": "Error", + "description": "Severity of Pylint message type 'Fatal/F'.", + "enum": [ + "Hint", + "Error", + "Information", + "Warning" + ] + }, + "python.linting.pep8CategorySeverity.W": { + "type": "string", + "default": "Warning", + "description": "Severity of Pep8 message type 'W'.", + "enum": [ + "Hint", + "Error", + "Information", + "Warning" + ] + }, + "python.linting.pep8CategorySeverity.E": { + "type": "string", + "default": "Error", + "description": "Severity of Pep8 message type 'E'.", + "enum": [ + "Hint", + "Error", + "Information", + "Warning" + ] + }, + "python.linting.flake8CategorySeverity.F": { + "type": "string", + "default": "Error", + "description": "Severity of Flake8 message type 'F'.", + "enum": [ + "Hint", + "Error", + "Information", + "Warning" + ] + }, + "python.linting.flake8CategorySeverity.E": { + "type": "string", + "default": "Error", + "description": "Severity of Flake8 message type 'E'.", + "enum": [ + "Hint", + "Error", + "Information", + "Warning" + ] + }, + "python.linting.flake8CategorySeverity.W": { + "type": "string", + "default": "Warning", + "description": "Severity of Flake8 message type 'W'.", + "enum": [ + "Hint", + "Error", + "Information", + "Warning" + ] + }, + "python.linting.mypyCategorySeverity.error": { + "type": "string", + "default": "Error", + "description": "Severity of Mypy message type 'Error'.", + "enum": [ + "Hint", + "Error", + "Information", + "Warning" + ] + }, + "python.linting.mypyCategorySeverity.note": { + "type": "string", + "default": "Information", + "description": "Severity of Mypy message type 'Note'.", + "enum": [ + "Hint", + "Error", + "Information", + "Warning" + ] + }, + "python.linting.prospectorPath": { + "type": "string", + "default": "prospector", + "description": "Path to Prospector, you can use a custom version of prospector by modifying this setting to include the full path." + }, + "python.linting.pylintPath": { + "type": "string", + "default": "pylint", + "description": "Path to Pylint, you can use a custom version of pylint by modifying this setting to include the full path." + }, + "python.linting.pep8Path": { + "type": "string", + "default": "pep8", + "description": "Path to pep8, you can use a custom version of pep8 by modifying this setting to include the full path." + }, + "python.linting.flake8Path": { + "type": "string", + "default": "flake8", + "description": "Path to flake8, you can use a custom version of flake8 by modifying this setting to include the full path." + }, + "python.linting.pydocstylePath": { + "type": "string", + "default": "pydocstyle", + "description": "Path to pydocstyle, you can use a custom version of pydocstyle by modifying this setting to include the full path." + }, + "python.linting.mypyPath": { + "type": "string", + "default": "mypy", + "description": "Path to mypy, you can use a custom version of mypy by modifying this setting to include the full path." + }, + "python.linting.prospectorArgs": { + "type": "array", + "description": "Arguments passed in. Each argument is a separate item in the array.", + "default": [], + "items": { + "type": "string" + } + }, + "python.linting.pylintArgs": { + "type": "array", + "description": "Arguments passed in. Each argument is a separate item in the array.", + "default": [], + "items": { + "type": "string" + } + }, + "python.linting.pep8Args": { + "type": "array", + "description": "Arguments passed in. Each argument is a separate item in the array.", + "default": [], + "items": { + "type": "string" + } + }, + "python.linting.flake8Args": { + "type": "array", + "description": "Arguments passed in. Each argument is a separate item in the array.", + "default": [], + "items": { + "type": "string" + } + }, + "python.linting.pydocstyleArgs": { + "type": "array", + "description": "Arguments passed in. Each argument is a separate item in the array.", + "default": [], + "items": { + "type": "string" + } + }, + "python.linting.mypyArgs": { + "type": "array", + "description": "Arguments passed in. Each argument is a separate item in the array.", + "default": [ + "--ignore-missing-imports", + "--follow-imports=silent" + ], + "items": { + "type": "string" + } + }, + "python.linting.outputWindow": { + "type": "string", + "default": "Python", + "description": "The output window name for the linting messages, defaults to Python output window." + }, + "python.formatting.provider": { + "type": "string", + "default": "autopep8", + "description": "Provider for formatting. Possible options include 'autopep8' and 'yapf'.", + "enum": [ + "autopep8", + "yapf", + "none" + ] + }, + "python.formatting.autopep8Path": { + "type": "string", + "default": "autopep8", + "description": "Path to autopep8, you can use a custom version of autopep8 by modifying this setting to include the full path." + }, + "python.formatting.yapfPath": { + "type": "string", + "default": "yapf", + "description": "Path to yapf, you can use a custom version of yapf by modifying this setting to include the full path." + }, + "python.formatting.autopep8Args": { + "type": "array", + "description": "Arguments passed in. Each argument is a separate item in the array.", + "default": [], + "items": { + "type": "string" + } + }, + "python.formatting.yapfArgs": { + "type": "array", + "description": "Arguments passed in. Each argument is a separate item in the array.", + "default": [], + "items": { + "type": "string" + } + }, + "python.formatting.formatOnSave": { + "type": "boolean", + "default": false, + "description": "Format the document upon saving." + }, + "python.formatting.outputWindow": { + "type": "string", + "default": "Python", + "description": "The output window name for the formatting messages, defaults to Python output window." + }, + "python.autoComplete.preloadModules": { + "type": "array", + "items": { + "type": "string" + }, + "default": [], + "description": "Comma delimited list of modules preloaded to speed up Auto Complete (e.g. add Numpy, Pandas, etc, items slow to load when autocompleting)." + }, + "python.autoComplete.extraPaths": { + "type": "array", + "default": [], + "description": "List of paths to libraries and the like that need to be imported by auto complete engine. E.g. when using Google App SDK, the paths are not in system path, hence need to be added into this list." + }, + "python.autoComplete.addBrackets": { + "type": "boolean", + "default": false, + "description": "Automatically add brackets for functions." + }, + "python.workspaceSymbols.tagFilePath": { + "type": "string", + "default": "${workspaceRoot}/.vscode/tags", + "description": "Fully qualified path to tag file (exuberant ctag file), used to provide workspace symbols." + }, + "python.workspaceSymbols.enabled": { + "type": "boolean", + "default": true, + "description": "Set to 'false' to disable Workspace Symbol provider using ctags." + }, + "python.workspaceSymbols.rebuildOnStart": { + "type": "boolean", + "default": true, + "description": "Whether to re-build the tags file on start (defaults to true)." + }, + "python.workspaceSymbols.rebuildOnFileSave": { + "type": "boolean", + "default": true, + "description": "Whether to re-build the tags file on when changes made to python files are saved." + }, + "python.workspaceSymbols.ctagsPath": { + "type": "string", + "default": "ctags", + "description": "Fully qualilified path to the ctags executable (else leave as ctags, assuming it is in current path)." + }, + "python.workspaceSymbols.exclusionPatterns": { + "type": "array", + "default": [ + "**/site-packages/**" + ], + "items": { + "type": "string" + }, + "description": "Pattern used to exclude files and folders from ctags See http://ctags.sourceforge.net/ctags.html." + }, + "python.unitTest.promptToConfigure": { + "type": "boolean", + "default": true, + "description": "Where to prompt to configure a test framework if potential tests directories are discovered." + }, + "python.unitTest.debugPort": { + "type": "number", + "default": 3000, + "description": "Port number used for debugging of unittests." + }, + "python.unitTest.nosetestsEnabled": { + "type": "boolean", + "default": false, + "description": "Whether to enable or disable unit testing using nosetests." + }, + "python.unitTest.nosetestPath": { + "type": "string", + "default": "nosetests", + "description": "Path to nosetests, you can use a custom version of nosetests by modifying this setting to include the full path." + }, + "python.unitTest.pyTestEnabled": { + "type": "boolean", + "default": false, + "description": "Whether to enable or disable unit testing using pytest." + }, + "python.unitTest.pyTestPath": { + "type": "string", + "default": "py.test", + "description": "Path to pytest (py.test), you can use a custom version of pytest by modifying this setting to include the full path." + }, + "python.unitTest.nosetestArgs": { + "type": "array", + "description": "Arguments passed in. Each argument is a separate item in the array.", + "default": [], + "items": { + "type": "string" + } + }, + "python.unitTest.pyTestArgs": { + "type": "array", + "description": "Arguments passed in. Each argument is a separate item in the array.", + "default": [], + "items": { + "type": "string" + } + }, + "python.unitTest.unittestEnabled": { + "type": "boolean", + "default": false, + "description": "Whether to enable or disable unit testing using unittest." + }, + "python.unitTest.unittestArgs": { + "type": "array", + "description": "Arguments passed in. Each argument is a separate item in the array.", + "default": [ + "-v", + "-s", + ".", + "-p", + "*test*.py" + ], + "items": { + "type": "string" + } + }, + "python.linting.ignorePatterns": { + "type": "array", + "description": "Patterns used to exclude files or folders from being linted.", + "default": [ + ".vscode/*.py", + "**/site-packages/**/*.py" + ], + "items": { + "type": "string" + } + }, + "python.linting.pylamaEnabled": { + "type": "boolean", + "default": false, + "description": "Whether to lint Python files using pylama." + }, + "python.linting.pylamaPath": { + "type": "string", + "default": "pylama", + "description": "Path to pylama, you can use a custom version of pylama by modifying this setting to include the full path." + }, + "python.linting.pylamaArgs": { + "type": "array", + "description": "Arguments passed in. Each argument is a separate item in the array.", + "default": [], + "items": { + "type": "string" + } + }, + "python.unitTest.outputWindow": { + "type": "string", + "default": "Python Test Log", + "description": "The output window name for the unit test messages, defaults to Python output window." + }, + "python.terminal.executeInFileDir": { + "type": "boolean", + "default": false, + "description": "When executing a file in the terminal, whether to use execute in the file's directory, instead of the current open folder." + }, + "python.terminal.launchArgs": { + "type": "array", + "default": [], + "description": "Python launch arguments to use when executing a file in the terminal." + }, + "python.jupyter.appendResults": { + "type": "boolean", + "default": true, + "description": "Whether to appen the results to results window, else clear and display." + }, + "python.jupyter.defaultKernel": { + "type": "string", + "default": "", + "description": "Default kernel to be used. By default the first available kernel is used." + }, + "python.jupyter.startupCode": { + "type": "array", + "items": { + "type": "string" + }, + "default": [ + "%matplotlib inline" + ], + "description": "Code executed when the kernel starts. Such as the default of '%matplotlib inline'. Individual lines can be placed in separate items of the array." + } + } + } + }, + "scripts": { + "vscode:prepublish": "tsc -p ./ && webpack", + "compile": "webpack && tsc -watch -p ./", + "postinstall": "node ./node_modules/vscode/bin/install", + "test": "node ./node_modules/vscode/bin/test", + "precommit": "node build/gulpfile.hygiene.js", + "lint": "tslint src/**/*.ts -t verbose" + }, + "pre-commit": [ + "precommit" + ], + "dependencies": { + "anser": "^1.1.0", + "copy-paste": "^1.3.0", + "diff-match-patch": "^1.0.0", + "fs-extra": "^0.30.0", + "fuzzy": "^0.1.3", + "line-by-line": "^0.1.5", + "minimatch": "^3.0.3", + "named-js-regexp": "^1.3.1", + "node-static": "^0.7.9", + "prepend-file": "^1.3.0", + "rx": "^4.1.0", + "socket.io": "^1.4.8", + "tmp": "0.0.29", + "transformime": "^3.1.2", + "transformime-marked": "0.0.1", + "tree-kill": "^1.1.0", + "uint64be": "^1.0.1", + "untildify": "^3.0.2", + "vscode-debugadapter": "^1.0.1", + "vscode-debugprotocol": "^1.0.1", + "vscode-extension-telemetry": "0.0.5", + "vscode-languageclient": "^1.1.0", + "vscode-languageserver": "^1.1.0", + "xml2js": "^0.4.17" + }, + "devDependencies": { + "@types/jquery": "^1.10.31", + "@types/mocha": "^2.2.32", + "@types/node": "^6.0.40", + "@types/rx": "^2.5.33", + "@types/sinon": "^2.3.2", + "@types/socket.io": "^1.4.27", + "@types/socket.io-client": "^1.4.27", + "@types/uuid": "^3.3.27", + "babel-core": "^6.14.0", + "babel-loader": "^6.2.5", + "babel-preset-es2015": "^6.14.0", + "gulp": "^3.9.1", + "gulp-eslint": "^4.0.0", + "gulp-filter": "^5.0.1", + "gulp-tslint": "^8.1.2", + "ignore-loader": "^0.1.1", + "mocha": "^2.3.3", + "precommit-hook": "^3.0.0", + "retyped-diff-match-patch-tsd-ambient": "^1.0.0-0", + "sinon": "^2.3.6", + "ts-loader": "^0.8.2", + "tslint": "^5.0.0", + "tslint-eslint-rules": "^4.1.1", + "tslint-microsoft-contrib": "^5.0.1", + "typescript": "^2.5.2", + "typescript-formatter": "^6.0.0", + "vscode": "^1.0.3", + "webpack": "^1.13.2" + } } diff --git a/tsfmt.json b/tsfmt.json new file mode 100644 index 000000000000..72a3195dbc9c --- /dev/null +++ b/tsfmt.json @@ -0,0 +1,16 @@ +{ + "tabSize": 4, + "indentSize": 4, + "convertTabsToSpaces": false, + "insertSpaceAfterCommaDelimiter": true, + "insertSpaceAfterSemicolonInForStatements": true, + "insertSpaceBeforeAndAfterBinaryOperators": true, + "insertSpaceAfterKeywordsInControlFlowStatements": true, + "insertSpaceAfterFunctionKeywordForAnonymousFunctions": true, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, + "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, + "insertSpaceBeforeFunctionParenthesis": false, + "placeOpenBraceOnNewLineForFunctions": false, + "placeOpenBraceOnNewLineForControlBlocks": false +} \ No newline at end of file diff --git a/tslint.json b/tslint.json index aec10615173d..38f630938153 100644 --- a/tslint.json +++ b/tslint.json @@ -1,13 +1,27 @@ { + "extends": [ + "tslint-eslint-rules", + "tslint-microsoft-contrib" + ], "rules": { "no-unused-expression": true, - "no-unreachable": true, "no-duplicate-variable": true, - "no-duplicate-key": true, "no-unused-variable": true, "curly": true, "class-name": true, - "semicolon": true, - "triple-equals": true + "semicolon": [ + true + ], + "triple-equals": true, + "no-relative-imports": false, + "max-line-length": false, + "typedef": false, + "no-string-throw": true, + "missing-jsdoc": false, + "one-line": false, + "no-parameter-properties": false, + "no-reserved-keywords": false, + "newline-before-return": false, + "export-name": false } } \ No newline at end of file From 8ffefb15c7ba1def1c5390e486b8eb30a0451862 Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Tue, 19 Sep 2017 22:16:25 -0700 Subject: [PATCH 02/10] gulp file to check code hygiene --- .vscode/settings.json | 1 - .vscode/tasks.json | 80 +- build/tslint.json | 27 - build/gulpfile.hygiene.js => gulpfile.js | 209 +- package.json | 3000 +++++++++++----------- tslint.json | 3 +- 6 files changed, 1567 insertions(+), 1753 deletions(-) delete mode 100644 build/tslint.json rename build/gulpfile.hygiene.js => gulpfile.js (55%) diff --git a/.vscode/settings.json b/.vscode/settings.json index 2dc22387c78a..32d2cbf20275 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -15,6 +15,5 @@ "python.formatting.formatOnSave": false, "python.unitTest.promptToConfigure": false, "python.workspaceSymbols.enabled": false, - "python.pythonPath": "/Users/donjayamanne/Projects/PythonEnvs/p27/bin/python", "python.formatting.provider": "yapf" } diff --git a/.vscode/tasks.json b/.vscode/tasks.json index b609ee31923f..8528527c98c9 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,53 +1,51 @@ -// // Available variables which can be used inside of strings. -// // ${workspaceRoot}: the root folder of the team -// // ${file}: the current opened file -// // ${fileBasename}: the current opened file's basename -// // ${fileDirname}: the current opened file's dirname -// // ${fileExtname}: the current opened file's extension -// // ${cwd}: the current working directory of the spawned process +// Available variables which can be used inside of strings. +// ${workspaceRoot}: the root folder of the team +// ${file}: the current opened file +// ${fileBasename}: the current opened file's basename +// ${fileDirname}: the current opened file's dirname +// ${fileExtname}: the current opened file's extension +// ${cwd}: the current working directory of the spawned process -// // A task runner that calls a custom npm script that compiles the extension. -// { -// "version": "0.1.0", - -// // we want to run npm -// "command": "npm", - -// // the command is a shell script -// "isShellCommand": true, - -// // show the output window only if unrecognized errors occur. -// "showOutput": "silent", - -// // we run the custom script "compile" as defined in package.json -// "args": ["run", "compile", "--loglevel", "silent"], - -// // The tsc compiler is started in watching mode -// "isWatching": true, - -// // use the standard tsc in watch mode problem matcher to find compile problems in the output. -// "problemMatcher": "$tsc-watch" -// } +// A task runner that calls a custom npm script that compiles the extension. { - "version": "0.1.0", + "version": "2.0.0", + "presentation": { + "echo": true, + "reveal": "always", + "focus": false, + "panel": "shared" + }, "tasks": [{ - "isShellCommand": true, - "args": [ - "run", "compile", "--loglevel", "silent" - ], + "label": "compile", + "type": "npm", + "script": "compile", + "group": "build", "isBackground": true, - "command": "npm", - "taskName": "build", - "showOutput": "silent", - "isBuildCommand": true, "problemMatcher": [ - "$tsc-watch" + "$tsc", + { + "base": "$tslint5", + "fileLocation": "relative" + } ] }, { - "command": "npm", + "type": "npm", "script": "lint", - "taskName": "lint", + "problemMatcher": { + "base": "$tslint5", + "fileLocation": "relative" + } + }, + { + "type": "npm", + "script": "watch", + "isBackground": true, + "problemMatcher": "$tsc-watch" + }, + { + "type": "gulp", + "task": "hygiene", "problemMatcher": { "base": "$tslint5", "fileLocation": "relative" diff --git a/build/tslint.json b/build/tslint.json deleted file mode 100644 index 38f630938153..000000000000 --- a/build/tslint.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "extends": [ - "tslint-eslint-rules", - "tslint-microsoft-contrib" - ], - "rules": { - "no-unused-expression": true, - "no-duplicate-variable": true, - "no-unused-variable": true, - "curly": true, - "class-name": true, - "semicolon": [ - true - ], - "triple-equals": true, - "no-relative-imports": false, - "max-line-length": false, - "typedef": false, - "no-string-throw": true, - "missing-jsdoc": false, - "one-line": false, - "no-parameter-properties": false, - "no-reserved-keywords": false, - "newline-before-return": false, - "export-name": false - } -} \ No newline at end of file diff --git a/build/gulpfile.hygiene.js b/gulpfile.js similarity index 55% rename from build/gulpfile.hygiene.js rename to gulpfile.js index 8476cc0a37cd..14713b79dfb1 100644 --- a/build/gulpfile.hygiene.js +++ b/gulpfile.js @@ -8,12 +8,8 @@ const gulp = require('gulp'); const filter = require('gulp-filter'); const es = require('event-stream'); -const gulptslint = require('gulp-tslint'); -const gulpeslint = require('gulp-eslint'); const tsfmt = require('typescript-formatter'); const tslint = require('tslint'); -const path = require('path'); -const fs = require('fs'); /** * Hygiene works by creating cascading subsets of all our files and @@ -31,20 +27,18 @@ const all = [ const eolFilter = [ '**', - '!ThirdPartyNotices.txt', - '!LICENSE.txt', - '!extensions/**/out/**', - '!test/smoke/out/**', + '!.editorconfig', + '!.eslintrc', + '!.gitignore', + '!.gitmodules', + '!.jshintignore', + '!.jshintrc', + '!.npmrc', + '!.vscodeignore', + '!LICENSE', + '!webpack.config.js', '!**/node_modules/**', - '!**/fixtures/**', - '!**/*.{svg,exe,png,bmp,scpt,bat,cmd,cur,ttf,woff,eot}', - '!build/{lib,tslintRules}/**/*.js', - '!build/monaco/**', - '!build/win32/**', - '!build/**/*.sh', - '!build/tfs/**/*.js', - '!**/Dockerfile', - '!build/**/*', + '!**/*.{svg,exe,png,bmp,scpt,bat,cmd,cur,ttf,woff,eot,txt,md,json,yml}', '!out/**/*', '!images/**/*', '!docs/**/*', @@ -53,68 +47,19 @@ const eolFilter = [ '!resources/**/*', '!snippets/**/*', '!syntaxes/**/*', - '!typings/**/*', + '!**/typings/**/*', ]; const indentationFilter = [ - '**', - '!ThirdPartyNotices.txt', - '!**/*.md', - '!**/*.ps1', - '!**/*.template', - '!**/*.yml', - '!**/lib/**', - '!extensions/**/*.d.ts', - '!src/typings/**/*.d.ts', - '!src/vs/*/**/*.d.ts', - '!**/*.d.ts.recipe', - '!test/assert.js', - '!**/package.json', - '!**/npm-shrinkwrap.json', - '!**/octicons/**', - '!**/vs/base/common/marked/raw.marked.js', - '!**/vs/base/common/winjs.base.raw.js', - '!**/vs/base/node/terminateProcess.sh', - '!**/vs/nls.js', - '!**/vs/css.js', - '!**/vs/loader.js', - '!extensions/**/snippets/**', - '!extensions/**/syntaxes/**', - '!extensions/**/themes/**', - '!extensions/**/colorize-fixtures/**', - '!extensions/vscode-api-tests/testWorkspace/**', - '!build/**/*', - '!out/**/*', - '!images/**/*', - '!docs/**/*', - '!.vscode/**/*', - '!pythonFiles/**/*', - '!resources/**/*', - '!snippets/**/*', - '!syntaxes/**/*', - '!typings/**/*', + 'src/**/*.ts', + '!**/typings/**/*', ]; -const copyrightFilter = [ - '**', - '!**/*.desktop', - '!**/*.json', - '!**/*.html', - '!**/*.template', - '!**/*.md', - '!**/*.bat', - '!**/*.cmd', - '!**/*.xml', - '!**/*.sh', - '!**/*.txt', - '!**/*.xpm', - '!**/*.opts', - '!**/*.disabled', - '!build/**/*.init', - '!resources/win32/bin/code.js', - '!extensions/markdown/media/tomorrow.css', - '!extensions/html/server/src/modes/typescript/*', - '!build/**/*', +const tslintFilter = [ + 'src/**/*.ts', + 'test/**/*.ts', + '!webpack.config.js', + '!**/node_modules/**', '!out/**/*', '!images/**/*', '!docs/**/*', @@ -123,61 +68,9 @@ const copyrightFilter = [ '!resources/**/*', '!snippets/**/*', '!syntaxes/**/*', - '!typings/**/*', + '!**/typings/**/*', ]; -const eslintFilter = [ - 'src/**/*.js', - 'build/gulpfile.*.js', - '!src/vs/loader.js', - '!src/vs/css.js', - '!src/vs/nls.js', - '!src/vs/css.build.js', - '!src/vs/nls.build.js', - '!src/**/winjs.base.raw.js', - '!src/**/raw.marked.js', - '!**/test/**', - '!build/**/*', - '!out/**/*', - '!images/**/*', - '!docs/**/*', - '!.vscode/**/*', - '!pythonFiles/**', - '!resources/**', - '!snippets/**', - '!syntaxes/**', - '!typings/**', -]; - -const tslintFilter = [ - 'src/**/*.ts', - 'test/**/*.ts', - 'extensions/**/*.ts', - '!**/fixtures/**', - '!**/typings/**', - '!**/node_modules/**', - '!extensions/typescript/test/colorize-fixtures/**', - '!extensions/vscode-api-tests/testWorkspace/**', - '!extensions/**/*.test.ts', - '!build/**', - '!out/**', - '!images/**', - '!docs/**', - '!.vscode/**', - '!pythonFiles/**', - '!resources/**', - '!snippets/**', - '!syntaxes/**', - '!typings/**', -]; - -const copyrightHeader = [ - '/*---------------------------------------------------------------------------------------------', - ' * Copyright (c) Microsoft Corporation. All rights reserved.', - ' * Licensed under the MIT License. See License.txt in the project root for license information.', - ' *--------------------------------------------------------------------------------------------*/' -].join('\n'); - function reportFailures(failures) { failures.forEach(failure => { const name = failure.name || failure.fileName; @@ -185,35 +78,12 @@ function reportFailures(failures) { const line = position.lineAndCharacter ? position.lineAndCharacter.line : position.line; const character = position.lineAndCharacter ? position.lineAndCharacter.character : position.character; - console.error(`${name}:${line + 1}:${character + 1}:${failure.failure}`); + // Output in format similar to tslint for the linter to pickup + console.error(`ERROR: (${failure.ruleName}) ${name}[${line + 1}, ${character + 1}]: ${failure.failure}`); + // console.error(`${name}:${line + 1}:${character + 1}:${failure.failure}`); }); } -gulp.task('eslint', () => { - return gulp.src(all, { - base: '.' - }) - .pipe(filter(eslintFilter)) - .pipe(gulpeslint('.eslintrc')) - .pipe(gulpeslint.formatEach('compact')) - .pipe(gulpeslint.failAfterError()); -}); - -gulp.task('tslint', () => { - const options = { - summarizeFailureOutput: true - }; - - return gulp.src(all, { - base: '.' - }) - .pipe(filter(tslintFilter)) - .pipe(gulptslint({ - rulesDirectory: 'build/lib/tslint' - })) - .pipe(gulptslint.report(reportFailures, options)); -}); - const hygiene = exports.hygiene = (some, options) => { options = options || {}; let errorCount = 0; @@ -234,10 +104,9 @@ const hygiene = exports.hygiene = (some, options) => { if (/^\s*$/.test(line)) { // empty or whitespace lines are OK } else if (/^[\t]*[^\s]/.test(line)) { - // good indent + console.error(file.relative + '(' + (i + 1) + ',1): Bad whitespace indentation'); + errorCount++; } else if (/^[\t]* \*/.test(line)) { - // block comment using an extra space - } else { console.error(file.relative + '(' + (i + 1) + ',1): Bad whitespace indentation'); errorCount++; } @@ -246,15 +115,6 @@ const hygiene = exports.hygiene = (some, options) => { this.emit('data', file); }); - const copyrights = es.through(function (file) { - if (file.contents.toString('utf8').indexOf(copyrightHeader) !== 0) { - console.error(file.relative + ': Missing or bad copyright statement'); - errorCount++; - } - - this.emit('data', file); - }); - const formatting = es.map(function (file, cb) { tsfmt.processString(file.path, file.contents.toString('utf8'), { verify: true, @@ -278,8 +138,7 @@ const hygiene = exports.hygiene = (some, options) => { const tsl = es.through(function (file) { const configuration = tslint.Configuration.findConfiguration(null, '.'); const options = { - formatter: 'json', - // rulesDirectory: ['node_modules/tslint-microsoft-contrib', 'node_modules/tslint-eslint-rules'] + formatter: 'json' }; const contents = file.contents.toString('utf8'); const linter = new tslint.Linter(options); @@ -303,9 +162,9 @@ const hygiene = exports.hygiene = (some, options) => { }) .pipe(filter(f => !f.stat.isDirectory())) .pipe(filter(eolFilter)) - .pipe(options.skipEOL ? es.through() : eol) - .pipe(filter(indentationFilter)); - // .pipe(indentation) + .pipe(options.skipEOL ? es.through() : eol); + // .pipe(filter(indentationFilter)) + // .pipe(indentation); // .pipe(filter(copyrightFilter)) // .pipe(copyrights); @@ -314,16 +173,10 @@ const hygiene = exports.hygiene = (some, options) => { // .pipe(formatting) .pipe(tsl); - // const javascript = result - // .pipe(filter(eslintFilter)) - // .pipe(gulpeslint('.eslintrc')) - // .pipe(gulpeslint.formatEach('compact')) - // .pipe(gulpeslint.failAfterError()); - - return es.merge(typescript) + return typescript .pipe(es.through(null, function () { if (errorCount > 0) { - this.emit('error', 'Hygiene failed with ' + errorCount + ' errors. Check \'build/gulpfile.hygiene.js\'.'); + this.emit('error', 'Hygiene failed with ' + errorCount + ' errors. Check \'gulpfile.js\'.'); } else { this.emit('end'); } diff --git a/package.json b/package.json index 944df1105fbc..7377e04d07d8 100644 --- a/package.json +++ b/package.json @@ -1,1530 +1,1520 @@ { - "name": "python", - "displayName": "Python", - "description": "Linting, Debugging (multi-threaded, remote), Intellisense, code formatting, refactoring, unit tests, snippets, Data Science (with Jupyter), PySpark and more.", - "version": "0.7.0", - "publisher": "donjayamanne", - "author": { - "name": "Don Jayamanne", - "email": "don.jayamanne@yahoo.com" - }, - "license": "MIT", - "homepage": "http://donjayamanne.github.io/pythonVSCode/", - "repository": { - "type": "git", - "url": "https://github.com/DonJayamanne/pythonVSCode" - }, - "bugs": { - "url": "https://github.com/DonJayamanne/pythonVSCode/issues" - }, - "icon": "icon.png", - "galleryBanner": { - "color": "#1e415e", - "theme": "dark" - }, - "engines": { - "vscode": "^1.9.0" - }, - "recommendations": [ - "donjayamanne.jupyter" - ], - "keywords": [ - "python", - "jupyter", - "django", - "debugger", - "unittest" - ], - "categories": [ - "Languages", - "Debuggers", - "Linters", - "Snippets", - "Formatters", - "Other" - ], - "activationEvents": [ - "onLanguage:python", - "onCommand:python.python-debug.startSession", - "onCommand:python.execInTerminal", - "onCommand:python.sortImports", - "onCommand:python.runtests", - "onCommand:python.debugtests", - "onCommand:python.setInterpreter", - "onCommand:python.viewTestUI", - "onCommand:python.viewTestOutput", - "onCommand:python.selectAndRunTestMethod", - "onCommand:python.selectAndDebugTestMethod", - "onCommand:python.selectAndRunTestFile", - "onCommand:python.runCurrentTestFile", - "onCommand:python.runFailedTests", - "onCommand:python.execSelectionInTerminal", - "onCommand:python.execSelectionInDjangoShell", - "onCommand:jupyter.runSelectionLine", - "onCommand:jupyter.execCurrentCell", - "onCommand:jupyter.execCurrentCellAndAdvance", - "onCommand:python.displayHelp", - "onCommand:python.buildWorkspaceSymbols", - "onCommand:python.updateSparkLibrary", - "onCommand:python.startREPL", - "onCommand:python.goToPythonObject" - ], - "main": "./out/client/extension", - "contributes": { - "snippets": [ - { - "language": "python", - "path": "./snippets/python.json" - } + "name": "python", + "displayName": "Python", + "description": "Linting, Debugging (multi-threaded, remote), Intellisense, code formatting, refactoring, unit tests, snippets, Data Science (with Jupyter), PySpark and more.", + "version": "0.7.0", + "publisher": "donjayamanne", + "author": { + "name": "Don Jayamanne", + "email": "don.jayamanne@yahoo.com" + }, + "license": "MIT", + "homepage": "http://donjayamanne.github.io/pythonVSCode/", + "repository": { + "type": "git", + "url": "https://github.com/DonJayamanne/pythonVSCode" + }, + "bugs": { + "url": "https://github.com/DonJayamanne/pythonVSCode/issues" + }, + "icon": "icon.png", + "galleryBanner": { + "color": "#1e415e", + "theme": "dark" + }, + "engines": { + "vscode": "^1.9.0" + }, + "recommendations": [ + "donjayamanne.jupyter" ], - "keybindings": [ - { - "command": "jupyter.runSelectionLine", - "key": "ctrl+alt+enter", - "when": "editorFocus && !replaceActive && !searchViewletVisible && !findWidgetVisible" - } + "keywords": [ + "python", + "jupyter", + "django", + "debugger", + "unittest" ], - "commands": [ - { - "command": "python.sortImports", - "title": "Sort Imports", - "category": "Python Refactor" - }, - { - "command": "python.startREPL", - "title": "Start REPL", - "category": "Python" - }, - { - "command": "python.buildWorkspaceSymbols", - "title": "Build Workspace Symbols", - "category": "Python" - }, - { - "command": "python.runtests", - "title": "Run All Unit Tests", - "category": "Python" - }, - { - "command": "python.debugtests", - "title": "Debug All Unit Tests", - "category": "Python" - }, - { - "command": "python.execInTerminal", - "title": "Run Python File in Terminal", - "category": "Python" - }, - { - "command": "python.setInterpreter", - "title": "Select Workspace Interpreter", - "category": "Python" - }, - { - "command": "python.updateSparkLibrary", - "title": "Update Workspace PySpark Libraries", - "category": "Python" - }, - { - "command": "python.refactorExtractVariable", - "title": "Extract Variable", - "category": "Python Refactor" - }, - { - "command": "python.refactorExtractMethod", - "title": "Extract Method", - "category": "Python Refactor" - }, - { - "command": "python.viewTestOutput", - "title": "Show Unit Test Output", - "category": "Python" - }, - { - "command": "python.selectAndRunTestMethod", - "title": "Run Unit Test Method ...", - "category": "Python" - }, - { - "command": "python.selectAndDebugTestMethod", - "title": "Debug Unit Test Method ...", - "category": "Python" - }, - { - "command": "python.selectAndRunTestFile", - "title": "Run Unit Test File ...", - "category": "Python" - }, - { - "command": "python.runCurrentTestFile", - "title": "Run Current Unit Test File", - "category": "Python" - }, - { - "command": "python.runFailedTests", - "title": "Run Failed Unit Tests", - "category": "Python" - }, - { - "command": "python.execSelectionInTerminal", - "title": "Run Selection/Line in Python Terminal", - "category": "Python" - }, - { - "command": "python.execSelectionInDjangoShell", - "title": "Run Selection/Line in Django Shell", - "category": "Python" - }, - { - "command": "jupyter.runSelectionLine", - "title": "Run Selection/Line", - "category": "Jupyter" - }, - { - "command": "jupyter.execCurrentCell", - "title": "Run Cell", - "category": "Jupyter" - }, - { - "command": "jupyter.execCurrentCellAndAdvance", - "title": "Run Cell and Advance", - "category": "Jupyter" - }, - { - "command": "jupyter.gotToPreviousCell", - "title": "Go to Previous Cell", - "category": "Jupyter" - }, - { - "command": "jupyter.gotToNextCell", - "title": "Go to Next Cell", - "category": "Jupyter" - }, - { - "command": "python.displayHelp", - "title": "Help", - "category": "Python" - }, - { - "command": "python.goToPythonObject", - "title": "Go to Python Object", - "category": "Python" - } + "categories": [ + "Languages", + "Debuggers", + "Linters", + "Snippets", + "Formatters", + "Other" ], - "menus": { - "editor/context": [ - { - "command": "python.refactorExtractVariable", - "title": "Refactor: Extract Variable", - "group": "Refactor", - "when": "editorHasSelection && editorLangId == python" - }, - { - "command": "python.refactorExtractMethod", - "title": "Refactor: Extract Method", - "group": "Refactor", - "when": "editorHasSelection && editorLangId == python" - }, - { - "command": "python.sortImports", - "title": "Refactor: Sort Imports", - "group": "Refactor", - "when": "editorLangId == python" - }, - { - "command": "python.execSelectionInTerminal", - "group": "Python", - "when": "editorHasSelection && editorLangId == python" - }, - { - "command": "python.execSelectionInDjangoShell", - "group": "Python", - "when": "editorHasSelection && editorLangId == python && python.isDjangoProject" - }, - { - "when": "resourceLangId == python", - "command": "python.execInTerminal", - "group": "Python" - }, - { - "when": "resourceLangId == python", - "command": "python.runCurrentTestFile", - "group": "Python" - } - ], - "explorer/context": [ - { - "when": "resourceLangId == python", - "command": "python.runtests", - "group": "Python" - }, - { - "when": "resourceLangId == python", - "command": "python.debugtests", - "group": "Python" - }, - { - "when": "resourceLangId == python", - "command": "python.execInTerminal", - "group": "Python" - } - ] - }, - "debuggers": [ - { - "type": "python", - "label": "Python", - "languages": [ - "python" - ], - "startSessionCommand": "python.python-debug.startSession", - "enableBreakpointsFor": { - "languageIds": [ - "python", - "html" - ] - }, - "aiKey": "fce7a3d5-4665-4404-b786-31a6306749a6", - "program": "./out/client/debugger/Main.js", - "runtime": "node", - "configurationSnippets": [ - { - "label": "%python.snippet.launch.standard.label%", - "description": "%python.snippet.launch.standard.description%", - "body": { - "name": "Python", - "type": "python", - "request": "launch", - "stopOnEntry": true, - "pythonPath": "^\"\\${config:python.pythonPath}\"", - "program": "^\"\\${file}\"", - "cwd": "^\"\\${workspaceRoot}\"", - "env": {}, - "envFile": "^\"\\${workspaceRoot}/.env\"", - "debugOptions": [ - "WaitOnAbnormalExit", - "WaitOnNormalExit", - "RedirectOutput" - ] - } - }, - { - "label": "%python.snippet.launch.pyspark.label%", - "description": "%python.snippet.launch.pyspark.description%", - "body": { - "name": "PySpark", - "type": "python", - "request": "launch", - "stopOnEntry": true, - "osx": { - "pythonPath": "^\"\\${env:SPARK_HOME}/bin/spark-submit\"" - }, - "windows": { - "pythonPath": "^\"\\${env:SPARK_HOME}/bin/spark-submit.cmd\"" - }, - "linux": { - "pythonPath": "^\"\\${env:SPARK_HOME}/bin/spark-submit\"" - }, - "program": "^\"\\${file}\"", - "cwd": "^\"\\${workspaceRoot}\"", - "env": {}, - "envFile": "^\"\\${workspaceRoot}/.env\"", - "debugOptions": [ - "WaitOnAbnormalExit", - "WaitOnNormalExit", - "RedirectOutput" - ] - } - }, - { - "label": "%python.snippet.launch.module.label%", - "description": "%python.snippet.launch.module.description%", - "body": { - "name": "Python Module", - "type": "python", - "request": "launch", - "stopOnEntry": true, - "pythonPath": "^\"\\${config:python.pythonPath}\"", - "module": "module.name", - "cwd": "^\"\\${workspaceRoot}\"", - "env": {}, - "envFile": "^\"\\${workspaceRoot}/.env\"", - "debugOptions": [ - "WaitOnAbnormalExit", - "WaitOnNormalExit", - "RedirectOutput" - ] - } - }, - { - "label": "%python.snippet.launch.terminal.label%", - "description": "%python.snippet.launch.terminal.description%", - "body": { - "name": "Integrated Terminal/Console", - "type": "python", - "request": "launch", - "stopOnEntry": true, - "pythonPath": "^\"\\${config:python.pythonPath}\"", - "program": "^\"\\${file}\"", - "cwd": "", - "console": "integratedTerminal", - "env": {}, - "envFile": "^\"\\${workspaceRoot}/.env\"", - "debugOptions": [ - "WaitOnAbnormalExit", - "WaitOnNormalExit" - ] - } - }, - { - "label": "%python.snippet.launch.externalTerminal.label%", - "description": "%python.snippet.launch.externalTerminal.description%", - "body": { - "name": "External Terminal/Console", - "type": "python", - "request": "launch", - "stopOnEntry": true, - "pythonPath": "^\"\\${config:python.pythonPath}\"", - "program": "^\"\\${file}\"", - "cwd": "", - "console": "externalTerminal", - "env": {}, - "envFile": "^\"\\${workspaceRoot}/.env\"", - "debugOptions": [ - "WaitOnAbnormalExit", - "WaitOnNormalExit" - ] - } - }, - { - "label": "%python.snippet.launch.django.label%", - "description": "%python.snippet.launch.django.description%", - "body": { - "name": "Django", - "type": "python", - "request": "launch", - "stopOnEntry": true, - "pythonPath": "^\"\\${config:python.pythonPath}\"", - "program": "^\"\\${workspaceRoot}/manage.py\"", - "cwd": "^\"\\${workspaceRoot}\"", - "args": [ - "runserver", - "--noreload", - "--nothreading" - ], - "env": {}, - "envFile": "^\"\\${workspaceRoot}/.env\"", - "debugOptions": [ - "WaitOnAbnormalExit", - "WaitOnNormalExit", - "RedirectOutput", - "DjangoDebugging" - ] - } - }, - { - "label": "%python.snippet.launch.flask.label%", - "description": "%python.snippet.launch.flask.description%", - "body": { - "name": "Flask", - "type": "python", - "request": "launch", - "stopOnEntry": false, - "pythonPath": "^\"\\${config:python.pythonPath}\"", - "program": "fully qualified path fo 'flask' executable. Generally located along with python interpreter", - "cwd": "^\"\\${workspaceRoot}\"", - "env": { - "FLASK_APP": "^\"\\${workspaceRoot}/quickstart/app.py\"" - }, - "args": [ - "run", - "--no-debugger", - "--no-reload" - ], - "envFile": "^\"\\${workspaceRoot}/.env\"", - "debugOptions": [ - "WaitOnAbnormalExit", - "WaitOnNormalExit", - "RedirectOutput" - ] - } - }, - { - "label": "%python.snippet.launch.flaskOld.label%", - "description": "%python.snippet.launch.flaskOld.description%", - "body": { - "name": "Flask (old)", - "type": "python", - "request": "launch", - "stopOnEntry": false, - "pythonPath": "^\"\\${config:python.pythonPath}\"", - "program": "^\"\\${workspaceRoot}/run.py\"", - "cwd": "^\"\\${workspaceRoot}\"", - "args": [], - "env": {}, - "envFile": "^\"\\${workspaceRoot}/.env\"", - "debugOptions": [ - "WaitOnAbnormalExit", - "WaitOnNormalExit", - "RedirectOutput" - ] - } - }, - { - "label": "%python.snippet.launch.pyramid.label%", - "description": "%python.snippet.launch.pyramid.description%", - "body": { - "name": "Pyramid", - "type": "python", - "request": "launch", - "stopOnEntry": true, - "pythonPath": "^\"\\${config:python.pythonPath}\"", - "cwd": "^\"\\${workspaceRoot}\"", - "env": {}, - "envFile": "^\"\\${workspaceRoot}/.env\"", - "args": [ - "^\"\\${workspaceRoot}/development.ini\"" - ], - "debugOptions": [ - "WaitOnAbnormalExit", - "WaitOnNormalExit", - "RedirectOutput", - "Pyramid" - ] - } - }, - { - "label": "%python.snippet.launch.watson.label%", - "description": "%python.snippet.launch.watson.description%", - "body": { - "name": "Watson", - "type": "python", - "request": "launch", - "stopOnEntry": true, - "pythonPath": "^\"\\${config:python.pythonPath}\"", - "program": "^\"\\${workspaceRoot}/console.py\"", - "cwd": "^\"\\${workspaceRoot}\"", - "args": [ - "dev", - "runserver", - "--noreload=True" - ], - "env": {}, - "envFile": "^\"\\${workspaceRoot}/.env\"", - "debugOptions": [ - "WaitOnAbnormalExit", - "WaitOnNormalExit", - "RedirectOutput" - ] - } - }, - { - "label": "%python.snippet.launch.scrapy.label%", - "description": "%python.snippet.launch.scrapy.description%", - "body": { - "name": "Scrapy", - "type": "python", - "request": "launch", - "stopOnEntry": true, - "pythonPath": "^\"\\${config:python.pythonPath}\"", - "program": "~/.virtualenvs/scrapy/bin/scrapy", - "cwd": "^\"\\${workspaceRoot}\"", - "args": [ - "crawl", - "specs", - "-o", - "bikes.json" - ], - "console": "integratedTerminal", - "env": {}, - "envFile": "^\"\\${workspaceRoot}/.env\"", - "debugOptions": [ - "WaitOnAbnormalExit", - "WaitOnNormalExit" - ] - } - }, - { - "label": "%python.snippet.launch.attach.label%", - "description": "%python.snippet.launch.attach.description%", - "body": { - "name": "Attach (Remote Debug)", - "type": "python", - "request": "attach", - "localRoot": "^\"\\${workspaceRoot}\"", - "remoteRoot": "^\"\\${workspaceRoot}\"", - "port": 3000, - "secret": "my_secret", - "host": "localhost" + "activationEvents": [ + "onLanguage:python", + "onCommand:python.python-debug.startSession", + "onCommand:python.execInTerminal", + "onCommand:python.sortImports", + "onCommand:python.runtests", + "onCommand:python.debugtests", + "onCommand:python.setInterpreter", + "onCommand:python.viewTestUI", + "onCommand:python.viewTestOutput", + "onCommand:python.selectAndRunTestMethod", + "onCommand:python.selectAndDebugTestMethod", + "onCommand:python.selectAndRunTestFile", + "onCommand:python.runCurrentTestFile", + "onCommand:python.runFailedTests", + "onCommand:python.execSelectionInTerminal", + "onCommand:python.execSelectionInDjangoShell", + "onCommand:jupyter.runSelectionLine", + "onCommand:jupyter.execCurrentCell", + "onCommand:jupyter.execCurrentCellAndAdvance", + "onCommand:python.displayHelp", + "onCommand:python.buildWorkspaceSymbols", + "onCommand:python.updateSparkLibrary", + "onCommand:python.startREPL", + "onCommand:python.goToPythonObject" + ], + "main": "./out/client/extension", + "contributes": { + "snippets": [{ + "language": "python", + "path": "./snippets/python.json" + }], + "keybindings": [{ + "command": "jupyter.runSelectionLine", + "key": "ctrl+alt+enter", + "when": "editorFocus && !replaceActive && !searchViewletVisible && !findWidgetVisible" + }], + "commands": [{ + "command": "python.sortImports", + "title": "Sort Imports", + "category": "Python Refactor" + }, + { + "command": "python.startREPL", + "title": "Start REPL", + "category": "Python" + }, + { + "command": "python.buildWorkspaceSymbols", + "title": "Build Workspace Symbols", + "category": "Python" + }, + { + "command": "python.runtests", + "title": "Run All Unit Tests", + "category": "Python" + }, + { + "command": "python.debugtests", + "title": "Debug All Unit Tests", + "category": "Python" + }, + { + "command": "python.execInTerminal", + "title": "Run Python File in Terminal", + "category": "Python" + }, + { + "command": "python.setInterpreter", + "title": "Select Workspace Interpreter", + "category": "Python" + }, + { + "command": "python.updateSparkLibrary", + "title": "Update Workspace PySpark Libraries", + "category": "Python" + }, + { + "command": "python.refactorExtractVariable", + "title": "Extract Variable", + "category": "Python Refactor" + }, + { + "command": "python.refactorExtractMethod", + "title": "Extract Method", + "category": "Python Refactor" + }, + { + "command": "python.viewTestOutput", + "title": "Show Unit Test Output", + "category": "Python" + }, + { + "command": "python.selectAndRunTestMethod", + "title": "Run Unit Test Method ...", + "category": "Python" + }, + { + "command": "python.selectAndDebugTestMethod", + "title": "Debug Unit Test Method ...", + "category": "Python" + }, + { + "command": "python.selectAndRunTestFile", + "title": "Run Unit Test File ...", + "category": "Python" + }, + { + "command": "python.runCurrentTestFile", + "title": "Run Current Unit Test File", + "category": "Python" + }, + { + "command": "python.runFailedTests", + "title": "Run Failed Unit Tests", + "category": "Python" + }, + { + "command": "python.execSelectionInTerminal", + "title": "Run Selection/Line in Python Terminal", + "category": "Python" + }, + { + "command": "python.execSelectionInDjangoShell", + "title": "Run Selection/Line in Django Shell", + "category": "Python" + }, + { + "command": "jupyter.runSelectionLine", + "title": "Run Selection/Line", + "category": "Jupyter" + }, + { + "command": "jupyter.execCurrentCell", + "title": "Run Cell", + "category": "Jupyter" + }, + { + "command": "jupyter.execCurrentCellAndAdvance", + "title": "Run Cell and Advance", + "category": "Jupyter" + }, + { + "command": "jupyter.gotToPreviousCell", + "title": "Go to Previous Cell", + "category": "Jupyter" + }, + { + "command": "jupyter.gotToNextCell", + "title": "Go to Next Cell", + "category": "Jupyter" + }, + { + "command": "python.displayHelp", + "title": "Help", + "category": "Python" + }, + { + "command": "python.goToPythonObject", + "title": "Go to Python Object", + "category": "Python" } - } ], - "configurationAttributes": { - "launch": { - "required": [ - "program" + "menus": { + "editor/context": [{ + "command": "python.refactorExtractVariable", + "title": "Refactor: Extract Variable", + "group": "Refactor", + "when": "editorHasSelection && editorLangId == python" + }, + { + "command": "python.refactorExtractMethod", + "title": "Refactor: Extract Method", + "group": "Refactor", + "when": "editorHasSelection && editorLangId == python" + }, + { + "command": "python.sortImports", + "title": "Refactor: Sort Imports", + "group": "Refactor", + "when": "editorLangId == python" + }, + { + "command": "python.execSelectionInTerminal", + "group": "Python", + "when": "editorHasSelection && editorLangId == python" + }, + { + "command": "python.execSelectionInDjangoShell", + "group": "Python", + "when": "editorHasSelection && editorLangId == python && python.isDjangoProject" + }, + { + "when": "resourceLangId == python", + "command": "python.execInTerminal", + "group": "Python" + }, + { + "when": "resourceLangId == python", + "command": "python.runCurrentTestFile", + "group": "Python" + } ], - "properties": { - "module": { - "type": "string", - "description": "Name of the module to be debugged.", - "default": "" - }, - "program": { - "type": "string", - "description": "Absolute path to the program.", - "default": "${file}" - }, - "pythonPath": { - "type": "string", - "description": "Path (fully qualified) to python executable. Defaults to the value in settings.json", - "default": "${config:python.pythonPath}" - }, - "args": { - "type": "array", - "description": "Command line arguments passed to the program", - "default": [], - "items": { - "type": "string" + "explorer/context": [{ + "when": "resourceLangId == python", + "command": "python.runtests", + "group": "Python" + }, + { + "when": "resourceLangId == python", + "command": "python.debugtests", + "group": "Python" + }, + { + "when": "resourceLangId == python", + "command": "python.execInTerminal", + "group": "Python" } - }, - "stopOnEntry": { - "type": "boolean", - "description": "Automatically stop after launch.", - "default": true - }, - "externalConsole": { - "type": "boolean", - "description": "Deprecated: use 'console' attribute instead.", - "default": false - }, - "console": { - "enum": [ - "none", - "integratedTerminal", - "externalTerminal" - ], - "description": "Where to launch the debug target: internal console, integrated terminal, or external terminal.", - "default": "none" - }, - "cwd": { - "type": "string", - "description": "Absolute path to the working directory of the program being debugged. Default is the root directory of the file (leave empty).", - "default": "" - }, - "debugOptions": { - "type": "array", - "description": "Advanced options, view read me for further details.", - "items": { - "type": "string", - "enum": [ - "WaitOnAbnormalExit", - "WaitOnNormalExit", - "RedirectOutput", - "DebugStdLib", - "BreakOnSystemExitZero", - "DjangoDebugging", - "Sudo", - "IgnoreDjangoTemplateWarnings", - "Pyramid" - ] - }, - "default": [ - "WaitOnAbnormalExit", - "WaitOnNormalExit", - "RedirectOutput" + ] + }, + "debuggers": [{ + "type": "python", + "label": "Python", + "languages": [ + "python" + ], + "startSessionCommand": "python.python-debug.startSession", + "enableBreakpointsFor": { + "languageIds": [ + "python", + "html" ] - }, - "exceptionHandling": { - "description": "List of exception types and how they are handled during debugging (ignore, always break or break only if unhandled).", - "properties": { - "ignore": { + }, + "aiKey": "fce7a3d5-4665-4404-b786-31a6306749a6", + "program": "./out/client/debugger/Main.js", + "runtime": "node", + "configurationSnippets": [{ + "label": "%python.snippet.launch.standard.label%", + "description": "%python.snippet.launch.standard.description%", + "body": { + "name": "Python", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "pythonPath": "^\"\\${config:python.pythonPath}\"", + "program": "^\"\\${file}\"", + "cwd": "^\"\\${workspaceRoot}\"", + "env": {}, + "envFile": "^\"\\${workspaceRoot}/.env\"", + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput" + ] + } + }, + { + "label": "%python.snippet.launch.pyspark.label%", + "description": "%python.snippet.launch.pyspark.description%", + "body": { + "name": "PySpark", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "osx": { + "pythonPath": "^\"\\${env:SPARK_HOME}/bin/spark-submit\"" + }, + "windows": { + "pythonPath": "^\"\\${env:SPARK_HOME}/bin/spark-submit.cmd\"" + }, + "linux": { + "pythonPath": "^\"\\${env:SPARK_HOME}/bin/spark-submit\"" + }, + "program": "^\"\\${file}\"", + "cwd": "^\"\\${workspaceRoot}\"", + "env": {}, + "envFile": "^\"\\${workspaceRoot}/.env\"", + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput" + ] + } + }, + { + "label": "%python.snippet.launch.module.label%", + "description": "%python.snippet.launch.module.description%", + "body": { + "name": "Python Module", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "pythonPath": "^\"\\${config:python.pythonPath}\"", + "module": "module.name", + "cwd": "^\"\\${workspaceRoot}\"", + "env": {}, + "envFile": "^\"\\${workspaceRoot}/.env\"", + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput" + ] + } + }, + { + "label": "%python.snippet.launch.terminal.label%", + "description": "%python.snippet.launch.terminal.description%", + "body": { + "name": "Integrated Terminal/Console", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "pythonPath": "^\"\\${config:python.pythonPath}\"", + "program": "^\"\\${file}\"", + "cwd": "", + "console": "integratedTerminal", + "env": {}, + "envFile": "^\"\\${workspaceRoot}/.env\"", + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit" + ] + } + }, + { + "label": "%python.snippet.launch.externalTerminal.label%", + "description": "%python.snippet.launch.externalTerminal.description%", + "body": { + "name": "External Terminal/Console", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "pythonPath": "^\"\\${config:python.pythonPath}\"", + "program": "^\"\\${file}\"", + "cwd": "", + "console": "externalTerminal", + "env": {}, + "envFile": "^\"\\${workspaceRoot}/.env\"", + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit" + ] + } + }, + { + "label": "%python.snippet.launch.django.label%", + "description": "%python.snippet.launch.django.description%", + "body": { + "name": "Django", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "pythonPath": "^\"\\${config:python.pythonPath}\"", + "program": "^\"\\${workspaceRoot}/manage.py\"", + "cwd": "^\"\\${workspaceRoot}\"", + "args": [ + "runserver", + "--noreload", + "--nothreading" + ], + "env": {}, + "envFile": "^\"\\${workspaceRoot}/.env\"", + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput", + "DjangoDebugging" + ] + } + }, + { + "label": "%python.snippet.launch.flask.label%", + "description": "%python.snippet.launch.flask.description%", + "body": { + "name": "Flask", + "type": "python", + "request": "launch", + "stopOnEntry": false, + "pythonPath": "^\"\\${config:python.pythonPath}\"", + "program": "fully qualified path fo 'flask' executable. Generally located along with python interpreter", + "cwd": "^\"\\${workspaceRoot}\"", + "env": { + "FLASK_APP": "^\"\\${workspaceRoot}/quickstart/app.py\"" + }, + "args": [ + "run", + "--no-debugger", + "--no-reload" + ], + "envFile": "^\"\\${workspaceRoot}/.env\"", + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput" + ] + } + }, + { + "label": "%python.snippet.launch.flaskOld.label%", + "description": "%python.snippet.launch.flaskOld.description%", + "body": { + "name": "Flask (old)", + "type": "python", + "request": "launch", + "stopOnEntry": false, + "pythonPath": "^\"\\${config:python.pythonPath}\"", + "program": "^\"\\${workspaceRoot}/run.py\"", + "cwd": "^\"\\${workspaceRoot}\"", + "args": [], + "env": {}, + "envFile": "^\"\\${workspaceRoot}/.env\"", + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput" + ] + } + }, + { + "label": "%python.snippet.launch.pyramid.label%", + "description": "%python.snippet.launch.pyramid.description%", + "body": { + "name": "Pyramid", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "pythonPath": "^\"\\${config:python.pythonPath}\"", + "cwd": "^\"\\${workspaceRoot}\"", + "env": {}, + "envFile": "^\"\\${workspaceRoot}/.env\"", + "args": [ + "^\"\\${workspaceRoot}/development.ini\"" + ], + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput", + "Pyramid" + ] + } + }, + { + "label": "%python.snippet.launch.watson.label%", + "description": "%python.snippet.launch.watson.description%", + "body": { + "name": "Watson", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "pythonPath": "^\"\\${config:python.pythonPath}\"", + "program": "^\"\\${workspaceRoot}/console.py\"", + "cwd": "^\"\\${workspaceRoot}\"", + "args": [ + "dev", + "runserver", + "--noreload=True" + ], + "env": {}, + "envFile": "^\"\\${workspaceRoot}/.env\"", + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput" + ] + } + }, + { + "label": "%python.snippet.launch.scrapy.label%", + "description": "%python.snippet.launch.scrapy.description%", + "body": { + "name": "Scrapy", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "pythonPath": "^\"\\${config:python.pythonPath}\"", + "program": "~/.virtualenvs/scrapy/bin/scrapy", + "cwd": "^\"\\${workspaceRoot}\"", + "args": [ + "crawl", + "specs", + "-o", + "bikes.json" + ], + "console": "integratedTerminal", + "env": {}, + "envFile": "^\"\\${workspaceRoot}/.env\"", + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit" + ] + } + }, + { + "label": "%python.snippet.launch.attach.label%", + "description": "%python.snippet.launch.attach.description%", + "body": { + "name": "Attach (Remote Debug)", + "type": "python", + "request": "attach", + "localRoot": "^\"\\${workspaceRoot}\"", + "remoteRoot": "^\"\\${workspaceRoot}\"", + "port": 3000, + "secret": "my_secret", + "host": "localhost" + } + } + ], + "configurationAttributes": { + "launch": { + "required": [ + "program" + ], + "properties": { + "module": { + "type": "string", + "description": "Name of the module to be debugged.", + "default": "" + }, + "program": { + "type": "string", + "description": "Absolute path to the program.", + "default": "${file}" + }, + "pythonPath": { + "type": "string", + "description": "Path (fully qualified) to python executable. Defaults to the value in settings.json", + "default": "${config:python.pythonPath}" + }, + "args": { + "type": "array", + "description": "Command line arguments passed to the program", + "default": [], + "items": { + "type": "string" + } + }, + "stopOnEntry": { + "type": "boolean", + "description": "Automatically stop after launch.", + "default": true + }, + "externalConsole": { + "type": "boolean", + "description": "Deprecated: use 'console' attribute instead.", + "default": false + }, + "console": { + "enum": [ + "none", + "integratedTerminal", + "externalTerminal" + ], + "description": "Where to launch the debug target: internal console, integrated terminal, or external terminal.", + "default": "none" + }, + "cwd": { + "type": "string", + "description": "Absolute path to the working directory of the program being debugged. Default is the root directory of the file (leave empty).", + "default": "" + }, + "debugOptions": { + "type": "array", + "description": "Advanced options, view read me for further details.", + "items": { + "type": "string", + "enum": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput", + "DebugStdLib", + "BreakOnSystemExitZero", + "DjangoDebugging", + "Sudo", + "IgnoreDjangoTemplateWarnings", + "Pyramid" + ] + }, + "default": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput" + ] + }, + "exceptionHandling": { + "description": "List of exception types and how they are handled during debugging (ignore, always break or break only if unhandled).", + "properties": { + "ignore": { + "type": "array", + "description": "Never break into these exceptions, e.g. 'copy.Error'", + "default": [], + "items": { + "type": "string" + } + }, + "always": { + "type": "array", + "description": "Always break into these exceptions, e.g. 'copy.Error'", + "default": [], + "items": { + "type": "string" + } + }, + "unhandled": { + "type": "array", + "description": "Break into these exceptions if they aren't handled, e.g. 'copy.Error'", + "default": [], + "items": { + "type": "string" + } + } + } + }, + "env": { + "type": "object", + "description": "Environment variables defined as a key value pair. Property ends up being the Environment Variable and the value of the property ends up being the value of the Env Variable.", + "default": {} + }, + "envFile": { + "type": "string", + "description": "Absolute path to a file containing environment variable definitions.", + "default": "" + } + } + }, + "attach": { + "required": [ + "localRoot", + "remoteRoot" + ], + "properties": { + "localRoot": { + "type": "string", + "description": "Local source root that corrresponds to the 'remoteRoot'.", + "default": "${workspaceRoot}" + }, + "remoteRoot": { + "type": "string", + "description": "The source root of the remote host.", + "default": "" + }, + "port": { + "type": "number", + "description": "Debug port to attach", + "default": 0 + }, + "host": { + "type": "string", + "description": "IP Address of the of remote server (default is localhost or use 127.0.0.1).", + "default": "localhost" + }, + "secret": { + "type": "string", + "description": "Secret used to authenticate for remote debugging.", + "default": "" + } + } + } + }, + "initialConfigurations": [{ + "name": "Python", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "pythonPath": "${config:python.pythonPath}", + "program": "${file}", + "cwd": "${workspaceRoot}", + "env": {}, + "envFile": "${workspaceRoot}/.env", + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput" + ] + }, + { + "name": "PySpark", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "osx": { + "pythonPath": "${env:SPARK_HOME}/bin/spark-submit" + }, + "windows": { + "pythonPath": "${env:SPARK_HOME}/bin/spark-submit.cmd" + }, + "linux": { + "pythonPath": "${env:SPARK_HOME}/bin/spark-submit" + }, + "program": "${file}", + "cwd": "${workspaceRoot}", + "env": {}, + "envFile": "${workspaceRoot}/.env", + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput" + ] + }, + { + "name": "Python Module", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "pythonPath": "${config:python.pythonPath}", + "module": "module.name", + "cwd": "${workspaceRoot}", + "env": {}, + "envFile": "${workspaceRoot}/.env", + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput" + ] + }, + { + "name": "Integrated Terminal/Console", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "pythonPath": "${config:python.pythonPath}", + "program": "${file}", + "cwd": "", + "console": "integratedTerminal", + "env": {}, + "envFile": "${workspaceRoot}/.env", + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit" + ] + }, + { + "name": "External Terminal/Console", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "pythonPath": "${config:python.pythonPath}", + "program": "${file}", + "cwd": "", + "console": "externalTerminal", + "env": {}, + "envFile": "${workspaceRoot}/.env", + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit" + ] + }, + { + "name": "Django", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "pythonPath": "${config:python.pythonPath}", + "program": "${workspaceRoot}/manage.py", + "cwd": "${workspaceRoot}", + "args": [ + "runserver", + "--noreload", + "--nothreading" + ], + "env": {}, + "envFile": "${workspaceRoot}/.env", + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput", + "DjangoDebugging" + ] + }, + { + "name": "Flask", + "type": "python", + "request": "launch", + "stopOnEntry": false, + "pythonPath": "${config:python.pythonPath}", + "program": "fully qualified path fo 'flask' executable. Generally located along with python interpreter", + "cwd": "${workspaceRoot}", + "env": { + "FLASK_APP": "${workspaceRoot}/quickstart/app.py" + }, + "args": [ + "run", + "--no-debugger", + "--no-reload" + ], + "envFile": "${workspaceRoot}/.env", + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput" + ] + }, + { + "name": "Flask (old)", + "type": "python", + "request": "launch", + "stopOnEntry": false, + "pythonPath": "${config:python.pythonPath}", + "program": "${workspaceRoot}/run.py", + "cwd": "${workspaceRoot}", + "args": [], + "env": {}, + "envFile": "${workspaceRoot}/.env", + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput" + ] + }, + { + "name": "Pyramid", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "pythonPath": "${config:python.pythonPath}", + "cwd": "${workspaceRoot}", + "env": {}, + "envFile": "${workspaceRoot}/.env", + "args": [ + "${workspaceRoot}/development.ini" + ], + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput", + "Pyramid" + ] + }, + { + "name": "Watson", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "pythonPath": "${config:python.pythonPath}", + "program": "${workspaceRoot}/console.py", + "cwd": "${workspaceRoot}", + "args": [ + "dev", + "runserver", + "--noreload=True" + ], + "env": {}, + "envFile": "${workspaceRoot}/.env", + "debugOptions": [ + "WaitOnAbnormalExit", + "WaitOnNormalExit", + "RedirectOutput" + ] + }, + { + "name": "Attach (Remote Debug)", + "type": "python", + "request": "attach", + "localRoot": "${workspaceRoot}", + "remoteRoot": "${workspaceRoot}", + "port": 3000, + "secret": "my_secret", + "host": "localhost" + } + ] + }], + "configuration": { + "type": "object", + "title": "Python Configuration", + "properties": { + "python.promptToInstallJupyter": { + "type": "boolean", + "default": true, + "description": "Display prompt to install Jupyter Extension." + }, + "python.pythonPath": { + "type": "string", + "default": "python", + "description": "Path to Python, you can use a custom version of Python by modifying this setting to include the full path." + }, + "python.venvPath": { + "type": "string", + "default": "", + "description": "Path to folder with a list of Virtual Environments (e.g. ~/.pyenv, ~/Envs, ~/.virtualenvs)." + }, + "python.envFile": { + "type": "string", + "description": "Absolute path to a file containing environment variable definitions.", + "default": "${workspaceRoot}/.env" + }, + "python.jediPath": { + "type": "string", + "default": "", + "description": "Path to directory containing the Jedi library (this path will contain the 'Jedi' sub directory)." + }, + "python.sortImports.path": { + "type": "string", + "description": "Path to isort script, default using inner version", + "default": "" + }, + "python.sortImports.args": { + "type": "array", + "description": "Arguments passed in. Each argument is a separate item in the array.", + "default": [], + "items": { + "type": "string" + } + }, + "python.linting.enabled": { + "type": "boolean", + "default": true, + "description": "Whether to lint Python files." + }, + "python.linting.enabledWithoutWorkspace": { + "type": "boolean", + "default": true, + "description": "Whether to lint Python files when no workspace is opened." + }, + "python.linting.prospectorEnabled": { + "type": "boolean", + "default": false, + "description": "Whether to lint Python files using prospector." + }, + "python.linting.pylintEnabled": { + "type": "boolean", + "default": true, + "description": "Whether to lint Python files using pylint." + }, + "python.linting.pep8Enabled": { + "type": "boolean", + "default": false, + "description": "Whether to lint Python files using pep8" + }, + "python.linting.flake8Enabled": { + "type": "boolean", + "default": false, + "description": "Whether to lint Python files using flake8" + }, + "python.linting.pydocstyleEnabled": { + "type": "boolean", + "default": false, + "description": "Whether to lint Python files using pydocstyle" + }, + "python.linting.mypyEnabled": { + "type": "boolean", + "default": false, + "description": "Whether to lint Python files using mypy." + }, + "python.linting.lintOnTextChange": { + "type": "boolean", + "default": true, + "description": "Whether to lint Python files when modified." + }, + "python.linting.lintOnSave": { + "type": "boolean", + "default": true, + "description": "Whether to lint Python files when saved." + }, + "python.linting.maxNumberOfProblems": { + "type": "number", + "default": 100, + "description": "Controls the maximum number of problems produced by the server." + }, + "python.linting.pylintCategorySeverity.convention": { + "type": "string", + "default": "Information", + "description": "Severity of Pylint message type 'Convention/C'.", + "enum": [ + "Hint", + "Error", + "Information", + "Warning" + ] + }, + "python.linting.pylintCategorySeverity.refactor": { + "type": "string", + "default": "Hint", + "description": "Severity of Pylint message type 'Refactor/R'.", + "enum": [ + "Hint", + "Error", + "Information", + "Warning" + ] + }, + "python.linting.pylintCategorySeverity.warning": { + "type": "string", + "default": "Warning", + "description": "Severity of Pylint message type 'Warning/W'.", + "enum": [ + "Hint", + "Error", + "Information", + "Warning" + ] + }, + "python.linting.pylintCategorySeverity.error": { + "type": "string", + "default": "Error", + "description": "Severity of Pylint message type 'Error/E'.", + "enum": [ + "Hint", + "Error", + "Information", + "Warning" + ] + }, + "python.linting.pylintCategorySeverity.fatal": { + "type": "string", + "default": "Error", + "description": "Severity of Pylint message type 'Fatal/F'.", + "enum": [ + "Hint", + "Error", + "Information", + "Warning" + ] + }, + "python.linting.pep8CategorySeverity.W": { + "type": "string", + "default": "Warning", + "description": "Severity of Pep8 message type 'W'.", + "enum": [ + "Hint", + "Error", + "Information", + "Warning" + ] + }, + "python.linting.pep8CategorySeverity.E": { + "type": "string", + "default": "Error", + "description": "Severity of Pep8 message type 'E'.", + "enum": [ + "Hint", + "Error", + "Information", + "Warning" + ] + }, + "python.linting.flake8CategorySeverity.F": { + "type": "string", + "default": "Error", + "description": "Severity of Flake8 message type 'F'.", + "enum": [ + "Hint", + "Error", + "Information", + "Warning" + ] + }, + "python.linting.flake8CategorySeverity.E": { + "type": "string", + "default": "Error", + "description": "Severity of Flake8 message type 'E'.", + "enum": [ + "Hint", + "Error", + "Information", + "Warning" + ] + }, + "python.linting.flake8CategorySeverity.W": { + "type": "string", + "default": "Warning", + "description": "Severity of Flake8 message type 'W'.", + "enum": [ + "Hint", + "Error", + "Information", + "Warning" + ] + }, + "python.linting.mypyCategorySeverity.error": { + "type": "string", + "default": "Error", + "description": "Severity of Mypy message type 'Error'.", + "enum": [ + "Hint", + "Error", + "Information", + "Warning" + ] + }, + "python.linting.mypyCategorySeverity.note": { + "type": "string", + "default": "Information", + "description": "Severity of Mypy message type 'Note'.", + "enum": [ + "Hint", + "Error", + "Information", + "Warning" + ] + }, + "python.linting.prospectorPath": { + "type": "string", + "default": "prospector", + "description": "Path to Prospector, you can use a custom version of prospector by modifying this setting to include the full path." + }, + "python.linting.pylintPath": { + "type": "string", + "default": "pylint", + "description": "Path to Pylint, you can use a custom version of pylint by modifying this setting to include the full path." + }, + "python.linting.pep8Path": { + "type": "string", + "default": "pep8", + "description": "Path to pep8, you can use a custom version of pep8 by modifying this setting to include the full path." + }, + "python.linting.flake8Path": { + "type": "string", + "default": "flake8", + "description": "Path to flake8, you can use a custom version of flake8 by modifying this setting to include the full path." + }, + "python.linting.pydocstylePath": { + "type": "string", + "default": "pydocstyle", + "description": "Path to pydocstyle, you can use a custom version of pydocstyle by modifying this setting to include the full path." + }, + "python.linting.mypyPath": { + "type": "string", + "default": "mypy", + "description": "Path to mypy, you can use a custom version of mypy by modifying this setting to include the full path." + }, + "python.linting.prospectorArgs": { + "type": "array", + "description": "Arguments passed in. Each argument is a separate item in the array.", + "default": [], + "items": { + "type": "string" + } + }, + "python.linting.pylintArgs": { + "type": "array", + "description": "Arguments passed in. Each argument is a separate item in the array.", + "default": [], + "items": { + "type": "string" + } + }, + "python.linting.pep8Args": { + "type": "array", + "description": "Arguments passed in. Each argument is a separate item in the array.", + "default": [], + "items": { + "type": "string" + } + }, + "python.linting.flake8Args": { + "type": "array", + "description": "Arguments passed in. Each argument is a separate item in the array.", + "default": [], + "items": { + "type": "string" + } + }, + "python.linting.pydocstyleArgs": { + "type": "array", + "description": "Arguments passed in. Each argument is a separate item in the array.", + "default": [], + "items": { + "type": "string" + } + }, + "python.linting.mypyArgs": { + "type": "array", + "description": "Arguments passed in. Each argument is a separate item in the array.", + "default": [ + "--ignore-missing-imports", + "--follow-imports=silent" + ], + "items": { + "type": "string" + } + }, + "python.linting.outputWindow": { + "type": "string", + "default": "Python", + "description": "The output window name for the linting messages, defaults to Python output window." + }, + "python.formatting.provider": { + "type": "string", + "default": "autopep8", + "description": "Provider for formatting. Possible options include 'autopep8' and 'yapf'.", + "enum": [ + "autopep8", + "yapf", + "none" + ] + }, + "python.formatting.autopep8Path": { + "type": "string", + "default": "autopep8", + "description": "Path to autopep8, you can use a custom version of autopep8 by modifying this setting to include the full path." + }, + "python.formatting.yapfPath": { + "type": "string", + "default": "yapf", + "description": "Path to yapf, you can use a custom version of yapf by modifying this setting to include the full path." + }, + "python.formatting.autopep8Args": { "type": "array", - "description": "Never break into these exceptions, e.g. 'copy.Error'", + "description": "Arguments passed in. Each argument is a separate item in the array.", "default": [], "items": { - "type": "string" + "type": "string" } - }, - "always": { + }, + "python.formatting.yapfArgs": { "type": "array", - "description": "Always break into these exceptions, e.g. 'copy.Error'", + "description": "Arguments passed in. Each argument is a separate item in the array.", "default": [], "items": { - "type": "string" + "type": "string" + } + }, + "python.formatting.formatOnSave": { + "type": "boolean", + "default": false, + "description": "Format the document upon saving." + }, + "python.formatting.outputWindow": { + "type": "string", + "default": "Python", + "description": "The output window name for the formatting messages, defaults to Python output window." + }, + "python.autoComplete.preloadModules": { + "type": "array", + "items": { + "type": "string" + }, + "default": [], + "description": "Comma delimited list of modules preloaded to speed up Auto Complete (e.g. add Numpy, Pandas, etc, items slow to load when autocompleting)." + }, + "python.autoComplete.extraPaths": { + "type": "array", + "default": [], + "description": "List of paths to libraries and the like that need to be imported by auto complete engine. E.g. when using Google App SDK, the paths are not in system path, hence need to be added into this list." + }, + "python.autoComplete.addBrackets": { + "type": "boolean", + "default": false, + "description": "Automatically add brackets for functions." + }, + "python.workspaceSymbols.tagFilePath": { + "type": "string", + "default": "${workspaceRoot}/.vscode/tags", + "description": "Fully qualified path to tag file (exuberant ctag file), used to provide workspace symbols." + }, + "python.workspaceSymbols.enabled": { + "type": "boolean", + "default": true, + "description": "Set to 'false' to disable Workspace Symbol provider using ctags." + }, + "python.workspaceSymbols.rebuildOnStart": { + "type": "boolean", + "default": true, + "description": "Whether to re-build the tags file on start (defaults to true)." + }, + "python.workspaceSymbols.rebuildOnFileSave": { + "type": "boolean", + "default": true, + "description": "Whether to re-build the tags file on when changes made to python files are saved." + }, + "python.workspaceSymbols.ctagsPath": { + "type": "string", + "default": "ctags", + "description": "Fully qualilified path to the ctags executable (else leave as ctags, assuming it is in current path)." + }, + "python.workspaceSymbols.exclusionPatterns": { + "type": "array", + "default": [ + "**/site-packages/**" + ], + "items": { + "type": "string" + }, + "description": "Pattern used to exclude files and folders from ctags See http://ctags.sourceforge.net/ctags.html." + }, + "python.unitTest.promptToConfigure": { + "type": "boolean", + "default": true, + "description": "Where to prompt to configure a test framework if potential tests directories are discovered." + }, + "python.unitTest.debugPort": { + "type": "number", + "default": 3000, + "description": "Port number used for debugging of unittests." + }, + "python.unitTest.nosetestsEnabled": { + "type": "boolean", + "default": false, + "description": "Whether to enable or disable unit testing using nosetests." + }, + "python.unitTest.nosetestPath": { + "type": "string", + "default": "nosetests", + "description": "Path to nosetests, you can use a custom version of nosetests by modifying this setting to include the full path." + }, + "python.unitTest.pyTestEnabled": { + "type": "boolean", + "default": false, + "description": "Whether to enable or disable unit testing using pytest." + }, + "python.unitTest.pyTestPath": { + "type": "string", + "default": "py.test", + "description": "Path to pytest (py.test), you can use a custom version of pytest by modifying this setting to include the full path." + }, + "python.unitTest.nosetestArgs": { + "type": "array", + "description": "Arguments passed in. Each argument is a separate item in the array.", + "default": [], + "items": { + "type": "string" + } + }, + "python.unitTest.pyTestArgs": { + "type": "array", + "description": "Arguments passed in. Each argument is a separate item in the array.", + "default": [], + "items": { + "type": "string" + } + }, + "python.unitTest.unittestEnabled": { + "type": "boolean", + "default": false, + "description": "Whether to enable or disable unit testing using unittest." + }, + "python.unitTest.unittestArgs": { + "type": "array", + "description": "Arguments passed in. Each argument is a separate item in the array.", + "default": [ + "-v", + "-s", + ".", + "-p", + "*test*.py" + ], + "items": { + "type": "string" + } + }, + "python.linting.ignorePatterns": { + "type": "array", + "description": "Patterns used to exclude files or folders from being linted.", + "default": [ + ".vscode/*.py", + "**/site-packages/**/*.py" + ], + "items": { + "type": "string" } - }, - "unhandled": { + }, + "python.linting.pylamaEnabled": { + "type": "boolean", + "default": false, + "description": "Whether to lint Python files using pylama." + }, + "python.linting.pylamaPath": { + "type": "string", + "default": "pylama", + "description": "Path to pylama, you can use a custom version of pylama by modifying this setting to include the full path." + }, + "python.linting.pylamaArgs": { "type": "array", - "description": "Break into these exceptions if they aren't handled, e.g. 'copy.Error'", + "description": "Arguments passed in. Each argument is a separate item in the array.", "default": [], "items": { - "type": "string" + "type": "string" } - } + }, + "python.unitTest.outputWindow": { + "type": "string", + "default": "Python Test Log", + "description": "The output window name for the unit test messages, defaults to Python output window." + }, + "python.terminal.executeInFileDir": { + "type": "boolean", + "default": false, + "description": "When executing a file in the terminal, whether to use execute in the file's directory, instead of the current open folder." + }, + "python.terminal.launchArgs": { + "type": "array", + "default": [], + "description": "Python launch arguments to use when executing a file in the terminal." + }, + "python.jupyter.appendResults": { + "type": "boolean", + "default": true, + "description": "Whether to appen the results to results window, else clear and display." + }, + "python.jupyter.defaultKernel": { + "type": "string", + "default": "", + "description": "Default kernel to be used. By default the first available kernel is used." + }, + "python.jupyter.startupCode": { + "type": "array", + "items": { + "type": "string" + }, + "default": [ + "%matplotlib inline" + ], + "description": "Code executed when the kernel starts. Such as the default of '%matplotlib inline'. Individual lines can be placed in separate items of the array." } - }, - "env": { - "type": "object", - "description": "Environment variables defined as a key value pair. Property ends up being the Environment Variable and the value of the property ends up being the value of the Env Variable.", - "default": {} - }, - "envFile": { - "type": "string", - "description": "Absolute path to a file containing environment variable definitions.", - "default": "" - } } - }, - "attach": { - "required": [ - "localRoot", - "remoteRoot" - ], - "properties": { - "localRoot": { - "type": "string", - "description": "Local source root that corrresponds to the 'remoteRoot'.", - "default": "${workspaceRoot}" - }, - "remoteRoot": { - "type": "string", - "description": "The source root of the remote host.", - "default": "" - }, - "port": { - "type": "number", - "description": "Debug port to attach", - "default": 0 - }, - "host": { - "type": "string", - "description": "IP Address of the of remote server (default is localhost or use 127.0.0.1).", - "default": "localhost" - }, - "secret": { - "type": "string", - "description": "Secret used to authenticate for remote debugging.", - "default": "" - } - } - } - }, - "initialConfigurations": [ - { - "name": "Python", - "type": "python", - "request": "launch", - "stopOnEntry": true, - "pythonPath": "${config:python.pythonPath}", - "program": "${file}", - "cwd": "${workspaceRoot}", - "env": {}, - "envFile": "${workspaceRoot}/.env", - "debugOptions": [ - "WaitOnAbnormalExit", - "WaitOnNormalExit", - "RedirectOutput" - ] - }, - { - "name": "PySpark", - "type": "python", - "request": "launch", - "stopOnEntry": true, - "osx": { - "pythonPath": "${env:SPARK_HOME}/bin/spark-submit" - }, - "windows": { - "pythonPath": "${env:SPARK_HOME}/bin/spark-submit.cmd" - }, - "linux": { - "pythonPath": "${env:SPARK_HOME}/bin/spark-submit" - }, - "program": "${file}", - "cwd": "${workspaceRoot}", - "env": {}, - "envFile": "${workspaceRoot}/.env", - "debugOptions": [ - "WaitOnAbnormalExit", - "WaitOnNormalExit", - "RedirectOutput" - ] - }, - { - "name": "Python Module", - "type": "python", - "request": "launch", - "stopOnEntry": true, - "pythonPath": "${config:python.pythonPath}", - "module": "module.name", - "cwd": "${workspaceRoot}", - "env": {}, - "envFile": "${workspaceRoot}/.env", - "debugOptions": [ - "WaitOnAbnormalExit", - "WaitOnNormalExit", - "RedirectOutput" - ] - }, - { - "name": "Integrated Terminal/Console", - "type": "python", - "request": "launch", - "stopOnEntry": true, - "pythonPath": "${config:python.pythonPath}", - "program": "${file}", - "cwd": "", - "console": "integratedTerminal", - "env": {}, - "envFile": "${workspaceRoot}/.env", - "debugOptions": [ - "WaitOnAbnormalExit", - "WaitOnNormalExit" - ] - }, - { - "name": "External Terminal/Console", - "type": "python", - "request": "launch", - "stopOnEntry": true, - "pythonPath": "${config:python.pythonPath}", - "program": "${file}", - "cwd": "", - "console": "externalTerminal", - "env": {}, - "envFile": "${workspaceRoot}/.env", - "debugOptions": [ - "WaitOnAbnormalExit", - "WaitOnNormalExit" - ] - }, - { - "name": "Django", - "type": "python", - "request": "launch", - "stopOnEntry": true, - "pythonPath": "${config:python.pythonPath}", - "program": "${workspaceRoot}/manage.py", - "cwd": "${workspaceRoot}", - "args": [ - "runserver", - "--noreload", - "--nothreading" - ], - "env": {}, - "envFile": "${workspaceRoot}/.env", - "debugOptions": [ - "WaitOnAbnormalExit", - "WaitOnNormalExit", - "RedirectOutput", - "DjangoDebugging" - ] - }, - { - "name": "Flask", - "type": "python", - "request": "launch", - "stopOnEntry": false, - "pythonPath": "${config:python.pythonPath}", - "program": "fully qualified path fo 'flask' executable. Generally located along with python interpreter", - "cwd": "${workspaceRoot}", - "env": { - "FLASK_APP": "${workspaceRoot}/quickstart/app.py" - }, - "args": [ - "run", - "--no-debugger", - "--no-reload" - ], - "envFile": "${workspaceRoot}/.env", - "debugOptions": [ - "WaitOnAbnormalExit", - "WaitOnNormalExit", - "RedirectOutput" - ] - }, - { - "name": "Flask (old)", - "type": "python", - "request": "launch", - "stopOnEntry": false, - "pythonPath": "${config:python.pythonPath}", - "program": "${workspaceRoot}/run.py", - "cwd": "${workspaceRoot}", - "args": [], - "env": {}, - "envFile": "${workspaceRoot}/.env", - "debugOptions": [ - "WaitOnAbnormalExit", - "WaitOnNormalExit", - "RedirectOutput" - ] - }, - { - "name": "Pyramid", - "type": "python", - "request": "launch", - "stopOnEntry": true, - "pythonPath": "${config:python.pythonPath}", - "cwd": "${workspaceRoot}", - "env": {}, - "envFile": "${workspaceRoot}/.env", - "args": [ - "${workspaceRoot}/development.ini" - ], - "debugOptions": [ - "WaitOnAbnormalExit", - "WaitOnNormalExit", - "RedirectOutput", - "Pyramid" - ] - }, - { - "name": "Watson", - "type": "python", - "request": "launch", - "stopOnEntry": true, - "pythonPath": "${config:python.pythonPath}", - "program": "${workspaceRoot}/console.py", - "cwd": "${workspaceRoot}", - "args": [ - "dev", - "runserver", - "--noreload=True" - ], - "env": {}, - "envFile": "${workspaceRoot}/.env", - "debugOptions": [ - "WaitOnAbnormalExit", - "WaitOnNormalExit", - "RedirectOutput" - ] - }, - { - "name": "Attach (Remote Debug)", - "type": "python", - "request": "attach", - "localRoot": "${workspaceRoot}", - "remoteRoot": "${workspaceRoot}", - "port": 3000, - "secret": "my_secret", - "host": "localhost" - } - ] - } - ], - "configuration": { - "type": "object", - "title": "Python Configuration", - "properties": { - "python.promptToInstallJupyter": { - "type": "boolean", - "default": true, - "description": "Display prompt to install Jupyter Extension." - }, - "python.pythonPath": { - "type": "string", - "default": "python", - "description": "Path to Python, you can use a custom version of Python by modifying this setting to include the full path." - }, - "python.venvPath": { - "type": "string", - "default": "", - "description": "Path to folder with a list of Virtual Environments (e.g. ~/.pyenv, ~/Envs, ~/.virtualenvs)." - }, - "python.envFile": { - "type": "string", - "description": "Absolute path to a file containing environment variable definitions.", - "default": "${workspaceRoot}/.env" - }, - "python.jediPath": { - "type": "string", - "default": "", - "description": "Path to directory containing the Jedi library (this path will contain the 'Jedi' sub directory)." - }, - "python.sortImports.path": { - "type": "string", - "description": "Path to isort script, default using inner version", - "default": "" - }, - "python.sortImports.args": { - "type": "array", - "description": "Arguments passed in. Each argument is a separate item in the array.", - "default": [], - "items": { - "type": "string" - } - }, - "python.linting.enabled": { - "type": "boolean", - "default": true, - "description": "Whether to lint Python files." - }, - "python.linting.enabledWithoutWorkspace": { - "type": "boolean", - "default": true, - "description": "Whether to lint Python files when no workspace is opened." - }, - "python.linting.prospectorEnabled": { - "type": "boolean", - "default": false, - "description": "Whether to lint Python files using prospector." - }, - "python.linting.pylintEnabled": { - "type": "boolean", - "default": true, - "description": "Whether to lint Python files using pylint." - }, - "python.linting.pep8Enabled": { - "type": "boolean", - "default": false, - "description": "Whether to lint Python files using pep8" - }, - "python.linting.flake8Enabled": { - "type": "boolean", - "default": false, - "description": "Whether to lint Python files using flake8" - }, - "python.linting.pydocstyleEnabled": { - "type": "boolean", - "default": false, - "description": "Whether to lint Python files using pydocstyle" - }, - "python.linting.mypyEnabled": { - "type": "boolean", - "default": false, - "description": "Whether to lint Python files using mypy." - }, - "python.linting.lintOnTextChange": { - "type": "boolean", - "default": true, - "description": "Whether to lint Python files when modified." - }, - "python.linting.lintOnSave": { - "type": "boolean", - "default": true, - "description": "Whether to lint Python files when saved." - }, - "python.linting.maxNumberOfProblems": { - "type": "number", - "default": 100, - "description": "Controls the maximum number of problems produced by the server." - }, - "python.linting.pylintCategorySeverity.convention": { - "type": "string", - "default": "Information", - "description": "Severity of Pylint message type 'Convention/C'.", - "enum": [ - "Hint", - "Error", - "Information", - "Warning" - ] - }, - "python.linting.pylintCategorySeverity.refactor": { - "type": "string", - "default": "Hint", - "description": "Severity of Pylint message type 'Refactor/R'.", - "enum": [ - "Hint", - "Error", - "Information", - "Warning" - ] - }, - "python.linting.pylintCategorySeverity.warning": { - "type": "string", - "default": "Warning", - "description": "Severity of Pylint message type 'Warning/W'.", - "enum": [ - "Hint", - "Error", - "Information", - "Warning" - ] - }, - "python.linting.pylintCategorySeverity.error": { - "type": "string", - "default": "Error", - "description": "Severity of Pylint message type 'Error/E'.", - "enum": [ - "Hint", - "Error", - "Information", - "Warning" - ] - }, - "python.linting.pylintCategorySeverity.fatal": { - "type": "string", - "default": "Error", - "description": "Severity of Pylint message type 'Fatal/F'.", - "enum": [ - "Hint", - "Error", - "Information", - "Warning" - ] - }, - "python.linting.pep8CategorySeverity.W": { - "type": "string", - "default": "Warning", - "description": "Severity of Pep8 message type 'W'.", - "enum": [ - "Hint", - "Error", - "Information", - "Warning" - ] - }, - "python.linting.pep8CategorySeverity.E": { - "type": "string", - "default": "Error", - "description": "Severity of Pep8 message type 'E'.", - "enum": [ - "Hint", - "Error", - "Information", - "Warning" - ] - }, - "python.linting.flake8CategorySeverity.F": { - "type": "string", - "default": "Error", - "description": "Severity of Flake8 message type 'F'.", - "enum": [ - "Hint", - "Error", - "Information", - "Warning" - ] - }, - "python.linting.flake8CategorySeverity.E": { - "type": "string", - "default": "Error", - "description": "Severity of Flake8 message type 'E'.", - "enum": [ - "Hint", - "Error", - "Information", - "Warning" - ] - }, - "python.linting.flake8CategorySeverity.W": { - "type": "string", - "default": "Warning", - "description": "Severity of Flake8 message type 'W'.", - "enum": [ - "Hint", - "Error", - "Information", - "Warning" - ] - }, - "python.linting.mypyCategorySeverity.error": { - "type": "string", - "default": "Error", - "description": "Severity of Mypy message type 'Error'.", - "enum": [ - "Hint", - "Error", - "Information", - "Warning" - ] - }, - "python.linting.mypyCategorySeverity.note": { - "type": "string", - "default": "Information", - "description": "Severity of Mypy message type 'Note'.", - "enum": [ - "Hint", - "Error", - "Information", - "Warning" - ] - }, - "python.linting.prospectorPath": { - "type": "string", - "default": "prospector", - "description": "Path to Prospector, you can use a custom version of prospector by modifying this setting to include the full path." - }, - "python.linting.pylintPath": { - "type": "string", - "default": "pylint", - "description": "Path to Pylint, you can use a custom version of pylint by modifying this setting to include the full path." - }, - "python.linting.pep8Path": { - "type": "string", - "default": "pep8", - "description": "Path to pep8, you can use a custom version of pep8 by modifying this setting to include the full path." - }, - "python.linting.flake8Path": { - "type": "string", - "default": "flake8", - "description": "Path to flake8, you can use a custom version of flake8 by modifying this setting to include the full path." - }, - "python.linting.pydocstylePath": { - "type": "string", - "default": "pydocstyle", - "description": "Path to pydocstyle, you can use a custom version of pydocstyle by modifying this setting to include the full path." - }, - "python.linting.mypyPath": { - "type": "string", - "default": "mypy", - "description": "Path to mypy, you can use a custom version of mypy by modifying this setting to include the full path." - }, - "python.linting.prospectorArgs": { - "type": "array", - "description": "Arguments passed in. Each argument is a separate item in the array.", - "default": [], - "items": { - "type": "string" - } - }, - "python.linting.pylintArgs": { - "type": "array", - "description": "Arguments passed in. Each argument is a separate item in the array.", - "default": [], - "items": { - "type": "string" - } - }, - "python.linting.pep8Args": { - "type": "array", - "description": "Arguments passed in. Each argument is a separate item in the array.", - "default": [], - "items": { - "type": "string" - } - }, - "python.linting.flake8Args": { - "type": "array", - "description": "Arguments passed in. Each argument is a separate item in the array.", - "default": [], - "items": { - "type": "string" - } - }, - "python.linting.pydocstyleArgs": { - "type": "array", - "description": "Arguments passed in. Each argument is a separate item in the array.", - "default": [], - "items": { - "type": "string" - } - }, - "python.linting.mypyArgs": { - "type": "array", - "description": "Arguments passed in. Each argument is a separate item in the array.", - "default": [ - "--ignore-missing-imports", - "--follow-imports=silent" - ], - "items": { - "type": "string" - } - }, - "python.linting.outputWindow": { - "type": "string", - "default": "Python", - "description": "The output window name for the linting messages, defaults to Python output window." - }, - "python.formatting.provider": { - "type": "string", - "default": "autopep8", - "description": "Provider for formatting. Possible options include 'autopep8' and 'yapf'.", - "enum": [ - "autopep8", - "yapf", - "none" - ] - }, - "python.formatting.autopep8Path": { - "type": "string", - "default": "autopep8", - "description": "Path to autopep8, you can use a custom version of autopep8 by modifying this setting to include the full path." - }, - "python.formatting.yapfPath": { - "type": "string", - "default": "yapf", - "description": "Path to yapf, you can use a custom version of yapf by modifying this setting to include the full path." - }, - "python.formatting.autopep8Args": { - "type": "array", - "description": "Arguments passed in. Each argument is a separate item in the array.", - "default": [], - "items": { - "type": "string" - } - }, - "python.formatting.yapfArgs": { - "type": "array", - "description": "Arguments passed in. Each argument is a separate item in the array.", - "default": [], - "items": { - "type": "string" - } - }, - "python.formatting.formatOnSave": { - "type": "boolean", - "default": false, - "description": "Format the document upon saving." - }, - "python.formatting.outputWindow": { - "type": "string", - "default": "Python", - "description": "The output window name for the formatting messages, defaults to Python output window." - }, - "python.autoComplete.preloadModules": { - "type": "array", - "items": { - "type": "string" - }, - "default": [], - "description": "Comma delimited list of modules preloaded to speed up Auto Complete (e.g. add Numpy, Pandas, etc, items slow to load when autocompleting)." - }, - "python.autoComplete.extraPaths": { - "type": "array", - "default": [], - "description": "List of paths to libraries and the like that need to be imported by auto complete engine. E.g. when using Google App SDK, the paths are not in system path, hence need to be added into this list." - }, - "python.autoComplete.addBrackets": { - "type": "boolean", - "default": false, - "description": "Automatically add brackets for functions." - }, - "python.workspaceSymbols.tagFilePath": { - "type": "string", - "default": "${workspaceRoot}/.vscode/tags", - "description": "Fully qualified path to tag file (exuberant ctag file), used to provide workspace symbols." - }, - "python.workspaceSymbols.enabled": { - "type": "boolean", - "default": true, - "description": "Set to 'false' to disable Workspace Symbol provider using ctags." - }, - "python.workspaceSymbols.rebuildOnStart": { - "type": "boolean", - "default": true, - "description": "Whether to re-build the tags file on start (defaults to true)." - }, - "python.workspaceSymbols.rebuildOnFileSave": { - "type": "boolean", - "default": true, - "description": "Whether to re-build the tags file on when changes made to python files are saved." - }, - "python.workspaceSymbols.ctagsPath": { - "type": "string", - "default": "ctags", - "description": "Fully qualilified path to the ctags executable (else leave as ctags, assuming it is in current path)." - }, - "python.workspaceSymbols.exclusionPatterns": { - "type": "array", - "default": [ - "**/site-packages/**" - ], - "items": { - "type": "string" - }, - "description": "Pattern used to exclude files and folders from ctags See http://ctags.sourceforge.net/ctags.html." - }, - "python.unitTest.promptToConfigure": { - "type": "boolean", - "default": true, - "description": "Where to prompt to configure a test framework if potential tests directories are discovered." - }, - "python.unitTest.debugPort": { - "type": "number", - "default": 3000, - "description": "Port number used for debugging of unittests." - }, - "python.unitTest.nosetestsEnabled": { - "type": "boolean", - "default": false, - "description": "Whether to enable or disable unit testing using nosetests." - }, - "python.unitTest.nosetestPath": { - "type": "string", - "default": "nosetests", - "description": "Path to nosetests, you can use a custom version of nosetests by modifying this setting to include the full path." - }, - "python.unitTest.pyTestEnabled": { - "type": "boolean", - "default": false, - "description": "Whether to enable or disable unit testing using pytest." - }, - "python.unitTest.pyTestPath": { - "type": "string", - "default": "py.test", - "description": "Path to pytest (py.test), you can use a custom version of pytest by modifying this setting to include the full path." - }, - "python.unitTest.nosetestArgs": { - "type": "array", - "description": "Arguments passed in. Each argument is a separate item in the array.", - "default": [], - "items": { - "type": "string" - } - }, - "python.unitTest.pyTestArgs": { - "type": "array", - "description": "Arguments passed in. Each argument is a separate item in the array.", - "default": [], - "items": { - "type": "string" - } - }, - "python.unitTest.unittestEnabled": { - "type": "boolean", - "default": false, - "description": "Whether to enable or disable unit testing using unittest." - }, - "python.unitTest.unittestArgs": { - "type": "array", - "description": "Arguments passed in. Each argument is a separate item in the array.", - "default": [ - "-v", - "-s", - ".", - "-p", - "*test*.py" - ], - "items": { - "type": "string" - } - }, - "python.linting.ignorePatterns": { - "type": "array", - "description": "Patterns used to exclude files or folders from being linted.", - "default": [ - ".vscode/*.py", - "**/site-packages/**/*.py" - ], - "items": { - "type": "string" - } - }, - "python.linting.pylamaEnabled": { - "type": "boolean", - "default": false, - "description": "Whether to lint Python files using pylama." - }, - "python.linting.pylamaPath": { - "type": "string", - "default": "pylama", - "description": "Path to pylama, you can use a custom version of pylama by modifying this setting to include the full path." - }, - "python.linting.pylamaArgs": { - "type": "array", - "description": "Arguments passed in. Each argument is a separate item in the array.", - "default": [], - "items": { - "type": "string" - } - }, - "python.unitTest.outputWindow": { - "type": "string", - "default": "Python Test Log", - "description": "The output window name for the unit test messages, defaults to Python output window." - }, - "python.terminal.executeInFileDir": { - "type": "boolean", - "default": false, - "description": "When executing a file in the terminal, whether to use execute in the file's directory, instead of the current open folder." - }, - "python.terminal.launchArgs": { - "type": "array", - "default": [], - "description": "Python launch arguments to use when executing a file in the terminal." - }, - "python.jupyter.appendResults": { - "type": "boolean", - "default": true, - "description": "Whether to appen the results to results window, else clear and display." - }, - "python.jupyter.defaultKernel": { - "type": "string", - "default": "", - "description": "Default kernel to be used. By default the first available kernel is used." - }, - "python.jupyter.startupCode": { - "type": "array", - "items": { - "type": "string" - }, - "default": [ - "%matplotlib inline" - ], - "description": "Code executed when the kernel starts. Such as the default of '%matplotlib inline'. Individual lines can be placed in separate items of the array." } - } + }, + "scripts": { + "vscode:prepublish": "tsc -p ./ && webpack", + "compile": "webpack && tsc -watch -p ./", + "postinstall": "node ./node_modules/vscode/bin/install", + "test": "node ./node_modules/vscode/bin/test", + "precommit": "node gulpfile.js", + "lint": "tslint src/**/*.ts -t verbose", + "validate": "npm ls" + }, + "pre-commit": [ + "precommit" + ], + "dependencies": { + "anser": "^1.1.0", + "copy-paste": "^1.3.0", + "diff-match-patch": "^1.0.0", + "fs-extra": "^0.30.0", + "fuzzy": "^0.1.3", + "line-by-line": "^0.1.5", + "minimatch": "^3.0.3", + "named-js-regexp": "^1.3.1", + "node-static": "^0.7.9", + "prepend-file": "^1.3.0", + "rx": "^4.1.0", + "socket.io": "^1.4.8", + "tmp": "0.0.29", + "transformime": "^3.1.2", + "transformime-marked": "0.0.1", + "tree-kill": "^1.1.0", + "uint64be": "^1.0.1", + "untildify": "^3.0.2", + "vscode-debugadapter": "^1.0.1", + "vscode-debugprotocol": "^1.0.1", + "vscode-extension-telemetry": "0.0.5", + "vscode-languageclient": "^1.1.0", + "vscode-languageserver": "^1.1.0", + "xml2js": "^0.4.17" + }, + "devDependencies": { + "@types/jquery": "^1.10.31", + "@types/mocha": "^2.2.32", + "@types/node": "^6.0.40", + "@types/rx": "^2.5.33", + "@types/sinon": "^2.3.2", + "@types/socket.io": "^1.4.27", + "@types/socket.io-client": "^1.4.27", + "@types/uuid": "^3.3.27", + "babel-core": "^6.14.0", + "babel-loader": "^6.2.5", + "babel-preset-es2015": "^6.14.0", + "gulp": "^3.9.1", + "gulp-eslint": "^4.0.0", + "gulp-filter": "^5.0.1", + "gulp-tslint": "^8.1.2", + "ignore-loader": "^0.1.1", + "mocha": "^2.3.3", + "precommit-hook": "^3.0.0", + "retyped-diff-match-patch-tsd-ambient": "^1.0.0-0", + "sinon": "^2.3.6", + "ts-loader": "^0.8.2", + "tslint": "^5.7.0", + "tslint-eslint-rules": "^4.1.1", + "tslint-microsoft-contrib": "^5.0.1", + "typescript": "^2.5.2", + "typescript-formatter": "^6.0.0", + "vscode": "^1.1.5", + "webpack": "^1.13.2" } - }, - "scripts": { - "vscode:prepublish": "tsc -p ./ && webpack", - "compile": "webpack && tsc -watch -p ./", - "postinstall": "node ./node_modules/vscode/bin/install", - "test": "node ./node_modules/vscode/bin/test", - "precommit": "node build/gulpfile.hygiene.js", - "lint": "tslint src/**/*.ts -t verbose" - }, - "pre-commit": [ - "precommit" - ], - "dependencies": { - "anser": "^1.1.0", - "copy-paste": "^1.3.0", - "diff-match-patch": "^1.0.0", - "fs-extra": "^0.30.0", - "fuzzy": "^0.1.3", - "line-by-line": "^0.1.5", - "minimatch": "^3.0.3", - "named-js-regexp": "^1.3.1", - "node-static": "^0.7.9", - "prepend-file": "^1.3.0", - "rx": "^4.1.0", - "socket.io": "^1.4.8", - "tmp": "0.0.29", - "transformime": "^3.1.2", - "transformime-marked": "0.0.1", - "tree-kill": "^1.1.0", - "uint64be": "^1.0.1", - "untildify": "^3.0.2", - "vscode-debugadapter": "^1.0.1", - "vscode-debugprotocol": "^1.0.1", - "vscode-extension-telemetry": "0.0.5", - "vscode-languageclient": "^1.1.0", - "vscode-languageserver": "^1.1.0", - "xml2js": "^0.4.17" - }, - "devDependencies": { - "@types/jquery": "^1.10.31", - "@types/mocha": "^2.2.32", - "@types/node": "^6.0.40", - "@types/rx": "^2.5.33", - "@types/sinon": "^2.3.2", - "@types/socket.io": "^1.4.27", - "@types/socket.io-client": "^1.4.27", - "@types/uuid": "^3.3.27", - "babel-core": "^6.14.0", - "babel-loader": "^6.2.5", - "babel-preset-es2015": "^6.14.0", - "gulp": "^3.9.1", - "gulp-eslint": "^4.0.0", - "gulp-filter": "^5.0.1", - "gulp-tslint": "^8.1.2", - "ignore-loader": "^0.1.1", - "mocha": "^2.3.3", - "precommit-hook": "^3.0.0", - "retyped-diff-match-patch-tsd-ambient": "^1.0.0-0", - "sinon": "^2.3.6", - "ts-loader": "^0.8.2", - "tslint": "^5.0.0", - "tslint-eslint-rules": "^4.1.1", - "tslint-microsoft-contrib": "^5.0.1", - "typescript": "^2.5.2", - "typescript-formatter": "^6.0.0", - "vscode": "^1.0.3", - "webpack": "^1.13.2" - } -} +} \ No newline at end of file diff --git a/tslint.json b/tslint.json index 38f630938153..b580d677e310 100644 --- a/tslint.json +++ b/tslint.json @@ -22,6 +22,7 @@ "no-parameter-properties": false, "no-reserved-keywords": false, "newline-before-return": false, - "export-name": false + "export-name": false, + "align": false } } \ No newline at end of file From f562fcc428983f0f18322a14ed96a0c814613de3 Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Tue, 19 Sep 2017 23:09:54 -0700 Subject: [PATCH 03/10] fix preLaunchTask in launch.json --- .vscode/launch.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 0d64d8b63590..a4f4daec4206 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -31,7 +31,7 @@ "stopOnEntry": false, "sourceMaps": true, "outDir": "${workspaceRoot}/out", - "preLaunchTask": "npm" + "preLaunchTask": "compile" }, { "name": "Launch Extension as debugServer", // https://code.visualstudio.com/docs/extensions/example-debuggers @@ -62,7 +62,7 @@ "outFiles": [ "${workspaceRoot}/out/**/*.js" ], - "preLaunchTask": "npm" + "preLaunchTask": "compile" }, { "name": "Python", From 4128820f785b7add636ec6eadfca1ccf8bfc4808 Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Wed, 4 Oct 2017 12:28:28 -0700 Subject: [PATCH 04/10] added missing packages --- .jshintignore | 1 + .jshintrc | 10 ++++++++++ gulpfile.js | 2 +- package.json | 3 +++ 4 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 .jshintignore create mode 100644 .jshintrc diff --git a/.jshintignore b/.jshintignore new file mode 100644 index 000000000000..3c3629e647f5 --- /dev/null +++ b/.jshintignore @@ -0,0 +1 @@ +node_modules diff --git a/.jshintrc b/.jshintrc new file mode 100644 index 000000000000..997b3f7d45e3 --- /dev/null +++ b/.jshintrc @@ -0,0 +1,10 @@ +{ + "node": true, + + "curly": true, + "latedef": true, + "quotmark": true, + "undef": true, + "unused": true, + "trailing": true +} diff --git a/gulpfile.js b/gulpfile.js index 14713b79dfb1..b85cee80138a 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -228,4 +228,4 @@ if (require.main === module) { }); }); }); -} \ No newline at end of file +} diff --git a/package.json b/package.json index 88258f98e0b7..25bf78abda0c 100644 --- a/package.json +++ b/package.json @@ -1565,6 +1565,9 @@ "babel-core": "^6.14.0", "babel-loader": "^6.2.5", "babel-preset-es2015": "^6.14.0", + "event-stream": "^3.3.4", + "gulp": "^3.9.1", + "gulp-filter": "^5.0.1", "ignore-loader": "^0.1.1", "mocha": "^2.3.3", "precommit-hook": "^3.0.0", From ccbf9085a1bf58da885f3efd8474c0ac369075bd Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Wed, 4 Oct 2017 16:37:30 -0700 Subject: [PATCH 05/10] enabled pre-commit using husky --- package.json | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/package.json b/package.json index 683e968d7990..eb363a09bc55 100644 --- a/package.json +++ b/package.json @@ -1518,9 +1518,6 @@ "lint": "tslint src/**/*.ts -t verbose", "validate": "npm ls" }, - "xpre-commit": [ - "precommit" - ], "dependencies": { "anser": "^1.1.0", "copy-paste": "^1.3.0", @@ -1569,9 +1566,9 @@ "event-stream": "^3.3.4", "gulp": "^3.9.1", "gulp-filter": "^5.0.1", + "husky": "^0.14.3", "ignore-loader": "^0.1.1", "mocha": "^2.3.3", - "precommit-hook": "^3.0.0", "retyped-diff-match-patch-tsd-ambient": "^1.0.0-0", "sinon": "^2.3.6", "ts-loader": "^0.8.2", From 4e23fc24d850833ec117277e45daa4a45c0ab077 Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Wed, 4 Oct 2017 17:35:17 -0700 Subject: [PATCH 06/10] enabled a few checks for precommit hook --- gulpfile.js | 24 +++++++++--------------- tslint.json | 5 +++-- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index b85cee80138a..0bb9e167f51e 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -80,7 +80,6 @@ function reportFailures(failures) { // Output in format similar to tslint for the linter to pickup console.error(`ERROR: (${failure.ruleName}) ${name}[${line + 1}, ${character + 1}]: ${failure.failure}`); - // console.error(`${name}:${line + 1}:${character + 1}:${failure.failure}`); }); } @@ -103,10 +102,9 @@ const hygiene = exports.hygiene = (some, options) => { .forEach((line, i) => { if (/^\s*$/.test(line)) { // empty or whitespace lines are OK - } else if (/^[\t]*[^\s]/.test(line)) { - console.error(file.relative + '(' + (i + 1) + ',1): Bad whitespace indentation'); - errorCount++; - } else if (/^[\t]* \*/.test(line)) { + } else if (/^(\s\s\s\s)+.*/.test(line)) { + // good indent + } else if (/^[\t]+.*/.test(line)) { console.error(file.relative + '(' + (i + 1) + ',1): Bad whitespace indentation'); errorCount++; } @@ -122,8 +120,6 @@ const hygiene = exports.hygiene = (some, options) => { editorconfig: true // verbose: true }).then(result => { - console.error('Has Error'); - console.error(result.error); if (result.error) { console.error(result.message); errorCount++; @@ -158,19 +154,17 @@ const hygiene = exports.hygiene = (some, options) => { }); const result = gulp.src(some || all, { - base: '.' - }) + base: '.' + }) .pipe(filter(f => !f.stat.isDirectory())) .pipe(filter(eolFilter)) - .pipe(options.skipEOL ? es.through() : eol); - // .pipe(filter(indentationFilter)) - // .pipe(indentation); - // .pipe(filter(copyrightFilter)) - // .pipe(copyrights); + .pipe(options.skipEOL ? es.through() : eol) + .pipe(filter(indentationFilter)) + .pipe(indentation); const typescript = result .pipe(filter(tslintFilter)) - // .pipe(formatting) + .pipe(formatting) .pipe(tsl); return typescript diff --git a/tslint.json b/tslint.json index b580d677e310..8868d292a5b8 100644 --- a/tslint.json +++ b/tslint.json @@ -23,6 +23,7 @@ "no-reserved-keywords": false, "newline-before-return": false, "export-name": false, - "align": false + "align": false, + "linebreak-style": false } -} \ No newline at end of file +} From 5221a7e69ef48ea8a1f355912188f64f466ce30c Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Wed, 4 Oct 2017 17:50:05 -0700 Subject: [PATCH 07/10] fix tslint warnings when running tslint via gulp --- gulpfile.js | 6 ++++-- package.json | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 0bb9e167f51e..c90803428d58 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -10,6 +10,7 @@ const filter = require('gulp-filter'); const es = require('event-stream'); const tsfmt = require('typescript-formatter'); const tslint = require('tslint'); +const relative = require('relative'); /** * Hygiene works by creating cascading subsets of all our files and @@ -79,7 +80,7 @@ function reportFailures(failures) { const character = position.lineAndCharacter ? position.lineAndCharacter.character : position.character; // Output in format similar to tslint for the linter to pickup - console.error(`ERROR: (${failure.ruleName}) ${name}[${line + 1}, ${character + 1}]: ${failure.failure}`); + console.error(`ERROR: (${failure.ruleName}) ${relative(__dirname, name)}[${line + 1}, ${character + 1}]: ${failure.failure}`); }); } @@ -137,7 +138,8 @@ const hygiene = exports.hygiene = (some, options) => { formatter: 'json' }; const contents = file.contents.toString('utf8'); - const linter = new tslint.Linter(options); + const program = require('tslint').Linter.createProgram("./tsconfig.json"); + const linter = new tslint.Linter(options, program); linter.lint(file.relative, contents, configuration.results); const result = linter.getResult(); if (result.failureCount > 0 || result.errorCount > 0) { diff --git a/package.json b/package.json index eb363a09bc55..6a568a923adb 100644 --- a/package.json +++ b/package.json @@ -1569,6 +1569,7 @@ "husky": "^0.14.3", "ignore-loader": "^0.1.1", "mocha": "^2.3.3", + "relative": "^3.0.2", "retyped-diff-match-patch-tsd-ambient": "^1.0.0-0", "sinon": "^2.3.6", "ts-loader": "^0.8.2", From 526645eebba3a4c380ddb6d530ed83d4535948f2 Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Wed, 4 Oct 2017 18:07:14 -0700 Subject: [PATCH 08/10] exclude webpack building, else tries to pull in tests as well --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 6a568a923adb..6c3c5d1e5a64 100644 --- a/package.json +++ b/package.json @@ -1511,7 +1511,8 @@ }, "scripts": { "vscode:prepublish": "tsc -p ./ && webpack", - "compile": "webpack && tsc -watch -p ./", + "compile": "tsc -watch -p ./", + "compileAll": "webpack && tsc -watch -p ./", "postinstall": "node ./node_modules/vscode/bin/install", "test": "node ./node_modules/vscode/bin/test", "precommit": "node gulpfile.js", From bcab80cb6a36dcaabe28dcc3182f541133d34aa0 Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Thu, 5 Oct 2017 10:21:29 -0700 Subject: [PATCH 09/10] improved checks for commits (strict) --- .vscode/settings.json | 2 +- .vscode/tasks.json | 15 +++++++++------ gulpfile.js | 34 +++++++++++++++++++++++++++++++++- package.json | 6 +++--- tsconfig.json | 4 ++-- 5 files changed, 48 insertions(+), 13 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 32d2cbf20275..2a0c5ce3b679 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,7 +1,7 @@ // Place your settings in this file to overwrite default and user settings. { "files.exclude": { - "out": false, // set this to true to hide the "out" folder with the compiled JS files + "out": true, // set this to true to hide the "out" folder with the compiled JS files "**/*.pyc": true, "**/__pycache__": true, "node_modules": true diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 169864cc7b86..9fe3969ccf07 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -5,7 +5,6 @@ // ${fileDirname}: the current opened file's dirname // ${fileExtname}: the current opened file's extension // ${cwd}: the current working directory of the spawned process - // A task runner that calls a custom npm script that compiles the extension. { "version": "2.0.0", @@ -15,7 +14,8 @@ "focus": false, "panel": "shared" }, - "tasks": [{ + "tasks": [ + { "label": "compile", "type": "npm", "script": "compile", @@ -46,10 +46,13 @@ { "type": "gulp", "task": "hygiene", - "problemMatcher": { - "base": "$tslint5", - "fileLocation": "relative" - } + "problemMatcher": [ + "$tsc", + { + "base": "$tslint5", + "fileLocation": "relative" + } + ] } ] } diff --git a/gulpfile.js b/gulpfile.js index c90803428d58..1dfa803235a2 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -11,6 +11,7 @@ const es = require('event-stream'); const tsfmt = require('typescript-formatter'); const tslint = require('tslint'); const relative = require('relative'); +const ts = require('gulp-typescript'); /** * Hygiene works by creating cascading subsets of all our files and @@ -155,6 +156,35 @@ const hygiene = exports.hygiene = (some, options) => { this.emit('data', file); }); + const tsFiles = []; + const tscFilesTracker = es.through(function (file) { + tsFiles.push(file.path.replace(/\\/g, '/')); + tsFiles.push(file.path); + this.emit('data', file); + }); + + const tsc = function () { + function customReporter() { + return { + error: function (error) { + const fullFilename = error.fullFilename || ''; + const relativeFilename = error.relativeFilename || ''; + if (tsFiles.findIndex(file => fullFilename === file || relativeFilename === file) === -1) { + return; + } + errorCount += 1; + console.error(error.message); + }, + finish: function () { + // forget the summary + } + }; + } + const tsProject = ts.createProject('tsconfig.json', { strict: true }); + const reporter = customReporter(); + return tsProject(reporter); + } + const result = gulp.src(some || all, { base: '.' }) @@ -167,7 +197,9 @@ const hygiene = exports.hygiene = (some, options) => { const typescript = result .pipe(filter(tslintFilter)) .pipe(formatting) - .pipe(tsl); + .pipe(tsl) + .pipe(tscFilesTracker) + .pipe(tsc()); return typescript .pipe(es.through(null, function () { diff --git a/package.json b/package.json index 6c3c5d1e5a64..54c563bee78b 100644 --- a/package.json +++ b/package.json @@ -1511,8 +1511,7 @@ }, "scripts": { "vscode:prepublish": "tsc -p ./ && webpack", - "compile": "tsc -watch -p ./", - "compileAll": "webpack && tsc -watch -p ./", + "compile": "webpack && tsc -watch -p ./", "postinstall": "node ./node_modules/vscode/bin/install", "test": "node ./node_modules/vscode/bin/test", "precommit": "node gulpfile.js", @@ -1567,13 +1566,14 @@ "event-stream": "^3.3.4", "gulp": "^3.9.1", "gulp-filter": "^5.0.1", + "gulp-typescript": "^3.2.2", "husky": "^0.14.3", "ignore-loader": "^0.1.1", "mocha": "^2.3.3", "relative": "^3.0.2", "retyped-diff-match-patch-tsd-ambient": "^1.0.0-0", "sinon": "^2.3.6", - "ts-loader": "^0.8.2", + "ts-loader": "^2.3.4", "tslint": "^5.7.0", "tslint-eslint-rules": "^4.1.1", "tslint-microsoft-contrib": "^5.0.1", diff --git a/tsconfig.json b/tsconfig.json index d0276a05085f..0b10f6fac53d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,7 +8,7 @@ ], "sourceMap": true, "rootDir": "src" - // TODO: better code + // TODO: enable to ensure all code complies with strict coding standards // , "strict": true }, "exclude": [ @@ -20,4 +20,4 @@ "src/client/src/typings", "docs" ] -} \ No newline at end of file +} From 505fbf33ae253810465b770ed732126eb809d254 Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Thu, 5 Oct 2017 10:27:41 -0700 Subject: [PATCH 10/10] added new lines --- .editorconfig | 2 +- .eslintrc | 2 +- package.json | 3 +-- tsfmt.json | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.editorconfig b/.editorconfig index b6161dff7746..10b09a5924b6 100644 --- a/.editorconfig +++ b/.editorconfig @@ -13,4 +13,4 @@ trim_trailing_whitespace = true # https://github.com/npm/npm/pull/3180#issuecomment-16336516 [{.travis.yml,npm-shrinkwrap.json,package.json}] indent_style = space -indent_size = 4 \ No newline at end of file +indent_size = 4 diff --git a/.eslintrc b/.eslintrc index ddf13cefc83c..7c2542a3c660 100644 --- a/.eslintrc +++ b/.eslintrc @@ -12,4 +12,4 @@ "semi": "warn" }, "extends": "eslint:recommended" -} \ No newline at end of file +} diff --git a/package.json b/package.json index 54c563bee78b..db801962d5ba 100644 --- a/package.json +++ b/package.json @@ -1515,8 +1515,7 @@ "postinstall": "node ./node_modules/vscode/bin/install", "test": "node ./node_modules/vscode/bin/test", "precommit": "node gulpfile.js", - "lint": "tslint src/**/*.ts -t verbose", - "validate": "npm ls" + "lint": "tslint src/**/*.ts -t verbose" }, "dependencies": { "anser": "^1.1.0", diff --git a/tsfmt.json b/tsfmt.json index 72a3195dbc9c..088362e2043d 100644 --- a/tsfmt.json +++ b/tsfmt.json @@ -13,4 +13,4 @@ "insertSpaceBeforeFunctionParenthesis": false, "placeOpenBraceOnNewLineForFunctions": false, "placeOpenBraceOnNewLineForControlBlocks": false -} \ No newline at end of file +}