提交 e090e146 编写于 作者: N Nick Guerrera

Mark /errolog output as v1.0.0

上级 4f3f9ecf
Introduction
============
The C# and Visual Basic compilers support a /errorlog:<file> switch on
the command line to log all diagnostics in a structured, JSON format.
The log format is SARIF (Static Analysis Results Interchange Format)
and is defined by https://github.com/sarif-standard/sarif-spec
Note that the format has not been finalized and the specification is
still a draft. It will remain subject to breaking changes until the
`version` property is emitted with a value of "1.0" or greater.
This document does not repeat the details of the SARIF format, but
rather adds information that is specific to the implementation provided
by the C# and Visual Basic Compilers.
Result Properties
================
The SARIF standard allows the `properties` property of `result` objects
to contain arbitrary (string, string) key-value pairs.
The keys and values used by the C# and VB compilers are serialized from
the corresponding `Microsoft.CodeAnalysis.Diagnostic` as follows:
Key | Value
------------------------ | ------------
"warningLevel" | `Diagnostic.WarningLevel`
"category" | `Diagnostic.Category`
"isEnabledByDefault" | `Diagnostic.IsEnabledByDefault
"customProperties" | `Diagnostic.Properties`
The log format is SARIF (Static Analysis Results Interchange Format):
See https://sarifweb.azurewebsites.net/ for the format specification,
JSON schema, and other related resources.
\ No newline at end of file
......@@ -36,8 +36,8 @@ public void AdditionalLocationsAsRelatedLocations()
string expected =
@"{
""$schema"": ""http://json.schemastore.org/sarif-1.0.0-beta.5"",
""version"": ""1.0.0-beta.5"",
""$schema"": ""http://json.schemastore.org/sarif-1.0.0"",
""version"": ""1.0.0"",
""runs"": [
{
""tool"": {
......@@ -146,8 +146,8 @@ public void DescriptorIdCollision()
string expected =
@"{
""$schema"": ""http://json.schemastore.org/sarif-1.0.0-beta.5"",
""version"": ""1.0.0-beta.5"",
""$schema"": ""http://json.schemastore.org/sarif-1.0.0"",
""version"": ""1.0.0"",
""runs"": [
{
""tool"": {
......
......@@ -37,8 +37,8 @@ public ErrorLogger(Stream stream, string toolName, string toolFileVersion, Versi
_culture = culture;
_writer.WriteObjectStart(); // root
_writer.Write("$schema", "http://json.schemastore.org/sarif-1.0.0-beta.5");
_writer.Write("version", "1.0.0-beta.5");
_writer.Write("$schema", "http://json.schemastore.org/sarif-1.0.0");
_writer.Write("version", "1.0.0");
_writer.WriteArrayStart("runs");
_writer.WriteObjectStart(); // run
......
......@@ -311,8 +311,8 @@ internal static string GetExpectedErrorLogHeader(string actualOutput, CommonComp
var expectedLanguage = compiler.GetCultureName();
return string.Format(@"{{
""$schema"": ""http://json.schemastore.org/sarif-1.0.0-beta.5"",
""version"": ""1.0.0-beta.5"",
""$schema"": ""http://json.schemastore.org/sarif-1.0.0"",
""version"": ""1.0.0"",
""runs"": [
{{
""tool"": {{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册