@@ -67,8 +67,7 @@ export default class CheckpatchProvider implements vscode.CodeActionProvider {
6767
6868 // testing given configuration:
6969 var re = / t o t a l : \d * e r r o r s , \d * w a r n i n g s , \d * l i n e s c h e c k e d / g;
70- let args = this . linterConfig . args . slice ( ) ;
71- args . push ( '--no-tree - ' ) ;
70+ var args = [ '--no-tree' ] ;
7271 let childProcess = cp . spawnSync ( this . linterConfig . path , args , { shell : true , input : ' ' } ) ;
7372 if ( childProcess . pid && re . test ( childProcess . stdout . toString ( ) ) ) {
7473 // all good
@@ -96,7 +95,7 @@ export default class CheckpatchProvider implements vscode.CodeActionProvider {
9695 private parseCheckpatchLog ( log : string , basePath : string ) : number {
9796 const dictionary : { [ fileUri : string ] : vscode . Diagnostic [ ] } = { } ;
9897
99- var re = / ( W A R N I N G | E R R O R ) : ? ( .+ ) : ( .+ ) ? (?: \n | \r \n | ) # \d + : F I L E : ( .* ) : ( \d + ) : / g;
98+ var re = / ( W A R N I N G | E R R O R | C H E C K ) : ? ( .+ ) : ( .+ ) ? (?: \n | \r \n | ) # \d + : F I L E : ( .* ) : ( \d + ) : / g;
10099 var matches ;
101100 while ( matches = re . exec ( log ) ) {
102101 let type = matches [ 2 ] ;
@@ -140,6 +139,8 @@ export default class CheckpatchProvider implements vscode.CodeActionProvider {
140139
141140 let childProcess = cp . spawn ( this . linterConfig . path , args , { shell : true } ) ;
142141 if ( childProcess . pid ) {
142+ // clean old diagostics. Prevents files with only one warning from being updated
143+ this . diagnosticCollection . delete ( textDocument . uri ) ;
143144 childProcess . stdout . on ( 'data' , ( data : Buffer ) => log += data ) ;
144145 childProcess . stdout . on ( 'end' , ( ) => this . parseCheckpatchLog ( log , '' ) ) ;
145146 } else {
0 commit comments