@@ -14,7 +14,13 @@ export interface IPythonSettings {
1414 autoComplete : IAutoCompeteSettings ;
1515 terminal : ITerminalSettings ;
1616 jupyter : JupyterSettings ;
17+ sortImports : ISortImportSettings ;
1718}
19+
20+ export interface ISortImportSettings {
21+ args : string [ ] ;
22+ }
23+
1824export interface IUnitTestSettings {
1925 nosetestsEnabled : boolean ;
2026 nosetestPath : string ;
@@ -113,11 +119,17 @@ export class PythonSettings extends EventEmitter implements IPythonSettings {
113119 }
114120 else {
115121 this . linting = lintingSettings ;
116- if ( IS_TEST_EXECUTION && ! this . linting ) {
117- this . linting = { } as ILintingSettings ;
118- }
122+ }
123+ let sortImportSettings = systemVariables . resolveAny ( pythonSettings . get < ISortImportSettings > ( 'sortImports' ) ) ;
124+ if ( this . sortImports ) {
125+ Object . assign < ISortImportSettings , ISortImportSettings > ( this . sortImports , sortImportSettings ) ;
126+ }
127+ else {
128+ this . sortImports = sortImportSettings ;
119129 }
120130 // Support for travis
131+ this . sortImports = this . sortImports ? this . sortImports : { args : [ ] } ;
132+ // Support for travis
121133 this . linting = this . linting ? this . linting : {
122134 enabled : false ,
123135 flake8Args : [ ] , flake8Enabled : false , flake8Path : 'flake' ,
@@ -182,6 +194,7 @@ export class PythonSettings extends EventEmitter implements IPythonSettings {
182194 }
183195 }
184196 this . emit ( 'change' ) ;
197+
185198 // Support for travis
186199 this . unitTest = this . unitTest ? this . unitTest : {
187200 nosetestArgs : [ ] , nosetestPath : 'nosetest' , nosetestsEnabled : false ,
@@ -228,6 +241,7 @@ export class PythonSettings extends EventEmitter implements IPythonSettings {
228241 public unitTest : IUnitTestSettings ;
229242 public terminal : ITerminalSettings ;
230243 public jupyter : JupyterSettings ;
244+ public sortImports : ISortImportSettings ;
231245}
232246
233247function getAbsolutePath ( pathToCheck : string , rootDir : string ) : string {
0 commit comments