11import * as assert from 'assert' ;
2- import * as fs from 'fs-extra' ;
32import * as path from 'path' ;
43import * as vscode from 'vscode' ;
54import { PythonSettings } from '../../client/common/configSettings' ;
@@ -22,7 +21,6 @@ const pep8ConfigPath = path.join(pythoFilesPath, 'pep8config');
2221const pydocstyleConfigPath27 = path . join ( pythoFilesPath , 'pydocstyleconfig27' ) ;
2322const pylintConfigPath = path . join ( pythoFilesPath , 'pylintconfig' ) ;
2423const fileToLint = path . join ( pythoFilesPath , 'file.py' ) ;
25- let pylintFileToLintLines : string [ ] = [ ] ;
2624
2725const pylintMessagesToBeReturned : baseLinter . ILintMessage [ ] = [
2826 { line : 24 , column : 0 , severity : baseLinter . LintMessageSeverity . Information , code : 'I0011' , message : 'Locally disabling no-member (E1101)' , provider : '' , type : '' } ,
@@ -114,7 +112,6 @@ suite('Linting', () => {
114112 const isPython3Deferred = createDeferred < boolean > ( ) ;
115113 const isPython3 = isPython3Deferred . promise ;
116114 suiteSetup ( async ( ) => {
117- pylintFileToLintLines = fs . readFileSync ( fileToLint ) . toString ( 'utf-8' ) . split ( / \r ? \n / g) ;
118115 await initialize ( ) ;
119116 const version = await execPythonFile ( fileToLint , PythonSettings . getInstance ( vscode . Uri . file ( fileToLint ) ) . pythonPath , [ '--version' ] , __dirname , true ) ;
120117 isPython3Deferred . resolve ( version . indexOf ( '3.' ) >= 0 ) ;
@@ -135,7 +132,6 @@ suite('Linting', () => {
135132 await updateSetting ( 'linting.enabled' , true , rootWorkspaceUri , vscode . ConfigurationTarget . WorkspaceFolder ) ;
136133 }
137134 await updateSetting ( 'linting.lintOnSave' , false , rootWorkspaceUri , vscode . ConfigurationTarget . Workspace ) ;
138- await updateSetting ( 'linting.lintOnTextChange' , false , rootWorkspaceUri , vscode . ConfigurationTarget . Workspace ) ;
139135 await updateSetting ( 'linting.pylintEnabled' , false , rootWorkspaceUri , vscode . ConfigurationTarget . Workspace ) ;
140136 await updateSetting ( 'linting.flake8Enabled' , false , rootWorkspaceUri , vscode . ConfigurationTarget . Workspace ) ;
141137 await updateSetting ( 'linting.pep8Enabled' , false , rootWorkspaceUri , vscode . ConfigurationTarget . Workspace ) ;
@@ -146,7 +142,6 @@ suite('Linting', () => {
146142
147143 if ( IS_MULTI_ROOT_TEST ) {
148144 await updateSetting ( 'linting.lintOnSave' , false , rootWorkspaceUri , vscode . ConfigurationTarget . WorkspaceFolder ) ;
149- await updateSetting ( 'linting.lintOnTextChange' , false , rootWorkspaceUri , vscode . ConfigurationTarget . WorkspaceFolder ) ;
150145 await updateSetting ( 'linting.pylintEnabled' , false , rootWorkspaceUri , vscode . ConfigurationTarget . WorkspaceFolder ) ;
151146 await updateSetting ( 'linting.flake8Enabled' , false , rootWorkspaceUri , vscode . ConfigurationTarget . WorkspaceFolder ) ;
152147 await updateSetting ( 'linting.pep8Enabled' , false , rootWorkspaceUri , vscode . ConfigurationTarget . WorkspaceFolder ) ;
@@ -164,8 +159,7 @@ suite('Linting', () => {
164159 const messages = await linter . lint ( editor . document , cancelToken . token ) ;
165160 if ( enabled ) {
166161 assert . notEqual ( messages . length , 0 , `No linter errors when linter is enabled, Output - ${ output . output } ` ) ;
167- }
168- else {
162+ } else {
169163 assert . equal ( messages . length , 0 , `Errors returned when linter is disabled, Output - ${ output . output } ` ) ;
170164 }
171165 }
@@ -217,8 +211,7 @@ suite('Linting', () => {
217211 const messages = await linter . lint ( editor . document , cancelToken . token ) ;
218212 if ( messagesToBeReceived . length === 0 ) {
219213 assert . equal ( messages . length , 0 , `No errors in linter, Output - ${ outputChannel . output } ` ) ;
220- }
221- else {
214+ } else {
222215 if ( outputChannel . output . indexOf ( 'ENOENT' ) === - 1 ) {
223216 // Pylint for Python Version 2.7 could return 80 linter messages, where as in 3.5 it might only return 1.
224217 // Looks like pylint stops linting as soon as it comes across any ERRORS.
0 commit comments