Skip to content

Commit 7b2143b

Browse files
committed
fixed config settings with defaults
1 parent 23d1ca1 commit 7b2143b

File tree

1 file changed

+47
-1
lines changed

1 file changed

+47
-1
lines changed

src/client/common/configSettings.ts

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import * as path from 'path';
77

88
export interface IPythonSettings {
99
pythonPath: string;
10-
devOptions: any[];
10+
devOptions: string[];
1111
linting: ILintingSettings;
1212
formatting: IFormattingSettings;
1313
unitTest: IUnitTestSettings;
@@ -117,6 +117,24 @@ export class PythonSettings extends EventEmitter implements IPythonSettings {
117117
this.linting = {} as ILintingSettings;
118118
}
119119
}
120+
// Support for travis
121+
this.linting = this.linting ? this.linting : {
122+
enabled: false,
123+
flake8Args: [], flake8Enabled: false, flake8Path: 'flake',
124+
lintOnSave: false, lintOnTextChange: false, maxNumberOfProblems: 100,
125+
mypyArgs: [], mypyEnabled: false, mypyPath: 'mypy',
126+
outputWindow: 'python', pep8Args: [], pep8Enabled: false, pep8Path: 'pep8',
127+
prospectorArgs: [], prospectorEnabled: false, prospectorPath: 'prospector',
128+
pydocstleArgs: [], pydocstyleEnabled: false, pydocStylePath: 'pydocstyle',
129+
pylintArgs: [], pylintEnabled: false, pylintPath: 'pylint',
130+
pylintCategorySeverity: {
131+
convention: vscode.DiagnosticSeverity.Hint,
132+
error: vscode.DiagnosticSeverity.Error,
133+
fatal: vscode.DiagnosticSeverity.Error,
134+
refactor: vscode.DiagnosticSeverity.Hint,
135+
warning: vscode.DiagnosticSeverity.Warning
136+
}
137+
};
120138
this.linting.pylintPath = getAbsolutePath(this.linting.pylintPath, workspaceRoot);
121139
this.linting.flake8Path = getAbsolutePath(this.linting.flake8Path, workspaceRoot);
122140
this.linting.pep8Path = getAbsolutePath(this.linting.pep8Path, workspaceRoot);
@@ -130,6 +148,13 @@ export class PythonSettings extends EventEmitter implements IPythonSettings {
130148
else {
131149
this.formatting = formattingSettings;
132150
}
151+
// Support for travis
152+
this.formatting = this.formatting ? this.formatting : {
153+
autopep8Args: [], autopep8Path: 'autopep8',
154+
formatOnSave: false, outputWindow: 'python',
155+
provider: 'autopep8',
156+
yapfArgs: [], yapfPath: 'yapf'
157+
};
133158
this.formatting.autopep8Path = getAbsolutePath(this.formatting.autopep8Path, workspaceRoot);
134159
this.formatting.yapfPath = getAbsolutePath(this.formatting.yapfPath, workspaceRoot);
135160

@@ -140,6 +165,10 @@ export class PythonSettings extends EventEmitter implements IPythonSettings {
140165
else {
141166
this.autoComplete = autoCompleteSettings;
142167
}
168+
// Support for travis
169+
this.autoComplete = this.autoComplete ? this.autoComplete : {
170+
extraPaths: []
171+
};
143172

144173
let unitTestSettings = systemVariables.resolveAny(pythonSettings.get<IUnitTestSettings>('unitTest'));
145174
if (this.unitTest) {
@@ -152,6 +181,13 @@ export class PythonSettings extends EventEmitter implements IPythonSettings {
152181
}
153182
}
154183
this.emit('change');
184+
// Support for travis
185+
this.unitTest = this.unitTest ? this.unitTest : {
186+
nosetestArgs: [], nosetestPath: 'nosetest', nosetestsEnabled: false,
187+
outputWindow: 'python',
188+
pyTestArgs: [], pyTestEnabled: false, pyTestPath: 'pytest',
189+
unittestArgs: [], unittestEnabled: false
190+
};
155191
this.unitTest.pyTestPath = getAbsolutePath(this.unitTest.pyTestPath, workspaceRoot);
156192
this.unitTest.nosetestPath = getAbsolutePath(this.unitTest.nosetestPath, workspaceRoot);
157193

@@ -170,7 +206,17 @@ export class PythonSettings extends EventEmitter implements IPythonSettings {
170206
this.terminal = {} as ITerminalSettings;
171207
}
172208
}
209+
// Support for travis
210+
this.terminal = this.terminal ? this.terminal : {
211+
executeInFileDir: true,
212+
launchArgs: []
213+
};
214+
173215
this.jupyter = pythonSettings.get<JupyterSettings>('jupyter');
216+
// Support for travis
217+
this.jupyter = this.jupyter ? this.jupyter : {
218+
appendResults: true, defaultKernel: '', startupCode: []
219+
};
174220
}
175221

176222
public pythonPath: string;

0 commit comments

Comments
 (0)