Skip to content
This repository has been archived by the owner on Dec 28, 2017. It is now read-only.

Commit

Permalink
Only read warnings containing a message and use default source for wa…
Browse files Browse the repository at this point in the history
…rnings without a source
  • Loading branch information
pascalberger committed May 15, 2017
1 parent a83f337 commit 7f0d3e3
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/Cake.Prca.Issues.DocFx/DocFxIssuesProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,21 @@ protected override IEnumerable<ICodeAnalysisIssue> InternalReadIssues(PrcaCommen
{
return
from logEntry in this.settings.LogFileContent.Split(new[] { '{', '}' }, StringSplitOptions.RemoveEmptyEntries).Select(x => "{" + x + "}")
let
logEntryObject = JsonConvert.DeserializeObject<JToken>(logEntry)
let logEntryObject = JsonConvert.DeserializeObject<JToken>(logEntry)
let severity = (string)logEntryObject.SelectToken("message_severity")
let file = (string)logEntryObject.SelectToken("file")
let message = (string)logEntryObject.SelectToken("message")
let source = (string)logEntryObject.SelectToken("source") ?? "DocFx"
where
(string)logEntryObject.SelectToken("message_severity") == "warning"
severity == "warning" &&
!string.IsNullOrWhiteSpace(message)
select
new CodeAnalysisIssue<DocFxIssuesProvider>(
(string)logEntryObject.SelectToken("file"),
file,
null,
(string)logEntryObject.SelectToken("message"),
message,
0,
(string)logEntryObject.SelectToken("source"));
source);
}
}
}

0 comments on commit 7f0d3e3

Please sign in to comment.