File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -24,10 +24,9 @@ import * as Config from './config';
24
24
import * as sonar from './sonar' ;
25
25
import * as validator from './config/config-validator' ;
26
26
import * as resourceLoader from './util/resource-loader' ;
27
-
28
27
import { getAsUris } from './util/get-as-uri' ;
29
-
30
28
import { loadJSONFile } from './util/file-loader' ;
29
+ import { Severity } from './interfaces' ;
31
30
32
31
const pkg = loadJSONFile ( path . join ( __dirname , '../../../package.json' ) ) ;
33
32
@@ -86,10 +85,15 @@ export const cli = {
86
85
for ( const target of targets ) {
87
86
try {
88
87
const results = await engine . executeOn ( target ) ; // eslint-disable-line no-await-in-loop
88
+ const hasError = results . some ( ( result ) => {
89
+ return result . severity === Severity . error ;
90
+ } ) ;
89
91
90
- if ( results . length > 0 ) {
92
+ format ( results ) ;
93
+
94
+ if ( hasError ) {
91
95
exitCode = 1 ;
92
- format ( results ) ;
96
+
93
97
}
94
98
} catch ( e ) {
95
99
exitCode = 1 ;
You can’t perform that action at this time.
0 commit comments