@@ -38,8 +38,9 @@ export class ApiIssueDiagnostic extends vscode.Diagnostic {
3838 const startCol = commitIssue . lineText . match ( / ^ ( \s * ) / ) ?. [ 1 ] . length || 0
3939 const endCol = startCol + commitIssue . lineText . trim ( ) . length
4040
41- const message = `[${ startCase ( commitIssue . patternInfo . category ) } ${ commitIssue . patternInfo . subCategory ? ` - ${ startCase ( commitIssue . patternInfo . subCategory ) } ` : ''
42- } ] ${ commitIssue . message } `
41+ const message = `[${ startCase ( commitIssue . patternInfo . category ) } ${
42+ commitIssue . patternInfo . subCategory ? ` - ${ startCase ( commitIssue . patternInfo . subCategory ) } ` : ''
43+ } ] ${ commitIssue . message } `
4344 const severity = patternSeverityToDiagnosticSeverity ( commitIssue . patternInfo . severityLevel )
4445
4546 const range = new vscode . Range ( line , startCol , line , endCol )
@@ -49,9 +50,9 @@ export class ApiIssueDiagnostic extends vscode.Diagnostic {
4950 this . source = `Codacy [${ commitIssue . toolInfo . name . replace ( 'Codacy ' , '' ) } ]`
5051 this . code = uri
5152 ? {
52- value : commitIssue . patternInfo . id ,
53- target : uri ,
54- }
53+ value : commitIssue . patternInfo . id ,
54+ target : uri ,
55+ }
5556 : undefined
5657 }
5758}
@@ -62,8 +63,8 @@ export class CliIssueDiagnostic extends vscode.Diagnostic {
6263 result . level === 'error'
6364 ? vscode . DiagnosticSeverity . Error
6465 : result . level === 'warning'
65- ? vscode . DiagnosticSeverity . Warning
66- : vscode . DiagnosticSeverity . Information
66+ ? vscode . DiagnosticSeverity . Warning
67+ : vscode . DiagnosticSeverity . Information
6768
6869 const range = new vscode . Range (
6970 ( result . region ?. startLine || 1 ) - 1 ,
@@ -77,9 +78,9 @@ export class CliIssueDiagnostic extends vscode.Diagnostic {
7778 this . source = `Codacy CLI [${ result . tool } ]`
7879 this . code = result . rule ?. helpUri
7980 ? {
80- value : result . rule . id ,
81- target : vscode . Uri . parse ( result . rule . helpUri ) ,
82- }
81+ value : result . rule . id ,
82+ target : vscode . Uri . parse ( result . rule . helpUri ) ,
83+ }
8384 : result . rule ?. id
8485 }
8586}
@@ -174,13 +175,13 @@ export class ProblemsDiagnosticCollection implements vscode.Disposable {
174175 // remove API issues found in the CLI issues
175176 const filteredApiIssues = documentCliIssues . length
176177 ? documentApiIssues . filter (
177- ( apiIssue ) =>
178- ! documentCliIssues . some (
179- ( cliIssue ) =>
180- cliIssue . message === apiIssue . commitIssue . message &&
181- cliIssue . region ?. startLine === apiIssue . commitIssue . lineNumber
182- )
183- )
178+ ( apiIssue ) =>
179+ ! documentCliIssues . some (
180+ ( cliIssue ) =>
181+ cliIssue . message === apiIssue . commitIssue . message &&
182+ cliIssue . region ?. startLine === apiIssue . commitIssue . lineNumber
183+ )
184+ )
184185 : documentApiIssues
185186
186187 const apiDiagnostics = filteredApiIssues . map ( ( { commitIssue, uri } ) => new ApiIssueDiagnostic ( commitIssue , uri ) )
@@ -272,7 +273,7 @@ export class ProblemsDiagnosticCollection implements vscode.Disposable {
272273 if ( ! fs . existsSync ( pathToFile ) ) {
273274 return
274275 }
275- if ( error instanceof CodacyError ) handleError ( error )
276+ if ( error instanceof CodacyError ) handleError ( error , false )
276277 else {
277278 handleError ( new CodacyError ( 'Error running analysis' , error as Error , 'CLI' ) )
278279 }
0 commit comments