@@ -9,15 +9,15 @@ open FSharpLint.Console.Output
99
1010let writeReport ( results : Suggestion.LintWarning list ) ( codeRoot : string option ) ( report : string ) ( logger : IOutput ) =
1111 try
12- let codeRoot =
12+ let codeRootDirectory =
1313 match codeRoot with
1414 | None -> Directory.GetCurrentDirectory() |> Uri
1515 | Some root -> Path.GetFullPath root |> Uri
1616
1717 // Construct full path to ensure path separators are normalized.
18- let report = Path.GetFullPath report
18+ let reportPath = Path.GetFullPath report
1919 // Ensure the parent directory exists
20- let reportFile = FileInfo( report )
20+ let reportFile = FileInfo( reportPath )
2121 reportFile.Directory.Create()
2222
2323 let driver =
@@ -32,7 +32,7 @@ let writeReport (results: Suggestion.LintWarning list) (codeRoot: string option)
3232
3333 use sarifLogger =
3434 new SarifLogger(
35- report ,
35+ reportPath ,
3636 logFilePersistenceOptions =
3737 ( FilePersistenceOptions.PrettyPrint ||| FilePersistenceOptions.ForceOverwrite),
3838 run = run,
@@ -53,28 +53,11 @@ let writeReport (results: Suggestion.LintWarning list) (codeRoot: string option)
5353 Name = analyzerResult.RuleName
5454 )
5555
56- (*
57- analyzerResult.ShortDescription
58- |> Option.iter (fun shortDescription ->
59- reportDescriptor.ShortDescription <-
60- MultiformatMessageString(shortDescription, shortDescription, dict [])
61- )
62- *)
63-
64- (*
65- result.Level <-
66- match analyzerResult.Message.Severity with
67- | Severity.Info -> FailureLevel.Note
68- | Severity.Hint -> FailureLevel.Note
69- | Severity.Warning -> FailureLevel.Warning
70- | Severity.Error -> FailureLevel.Error
71- *)
72-
7356 let msg = Message( Text = analyzerResult.Details.Message)
7457
7558 let artifactLocation =
7659 ArtifactLocation(
77- Uri = codeRoot .MakeRelativeUri( Uri( analyzerResult.Details.Range.FileName))
60+ Uri = codeRootDirectory .MakeRelativeUri( Uri( analyzerResult.Details.Range.FileName))
7861 )
7962
8063 let region =
0 commit comments