Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions news/2 Fixes/2571.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix bug affecting multiple linters used in a workspace.
(thanks [Ilia Novoselov](https://github.com/nullie))
11 changes: 7 additions & 4 deletions src/client/common/process/proc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,17 +168,20 @@ export class ProcessService implements IProcessService {
}

private getDefaultOptions<T extends (ShellOptions | SpawnOptions)>(options: T) : T {
const execOptions = options as SpawnOptions;
const defaultOptions = JSON.parse(JSON.stringify(options));
const defaultOptions = { ...options };
const execOptions = defaultOptions as SpawnOptions;
if (execOptions)
{
const encoding = execOptions.encoding = typeof execOptions.encoding === 'string' && execOptions.encoding.length > 0 ? execOptions.encoding : DEFAULT_ENCODING;
delete execOptions.encoding;
defaultOptions.encoding = encoding;
execOptions.encoding = encoding;
execOptions.token = execOptions.token;
}
if (!defaultOptions.env || Object.keys(defaultOptions).length === 0) {
if (!defaultOptions.env || Object.keys(defaultOptions.env).length === 0) {
const env = this.env ? this.env : process.env;
defaultOptions.env = { ...env };
} else {
defaultOptions.env = { ...defaultOptions.env };
}

// Always ensure we have unbuffered output.
Expand Down
11 changes: 0 additions & 11 deletions src/test/linters/lint.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,17 +271,6 @@ suite('Linting - General Tests', () => {
});
// tslint:disable-next-line:no-function-expression
test('Multiple linters', async function () {
// Unreliable test being skipped until we can sort it out. See gh-2609.
// - Fails about 1/3 of runs on Windows
// - Symptom: lintingEngine::lintOpenPythonFiles returns values *after* command await resolves in lint.tests
// - lintOpenPythonFiles returns 3 sets of values, not what I expect (1).
// - Haven't yet found a way to await on this properly.
const skipped = true;
if (skipped) {
// tslint:disable-next-line:no-invalid-this
return this.skip();
}

await closeActiveWindows();
const document = await workspace.openTextDocument(path.join(pythoFilesPath, 'print.py'));
await window.showTextDocument(document);
Expand Down