Skip to content

Commit 7627a53

Browse files
authored
Merge pull request github#12371 from github/mbg/csharp/increase-diagnostic-visibility
C#: Make diagnostics visible everywhere
2 parents 974fdd3 + 6c501d1 commit 7627a53

File tree

8 files changed

+52
-16
lines changed

8 files changed

+52
-16
lines changed

csharp/extractor/Semmle.Util/ToolStatusPage.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ public enum TspSeverity
5757
/// </summary>
5858
public class TspVisibility
5959
{
60+
/// <summary>
61+
/// A read-only instance of <see cref="TspVisibility" /> which indicates that the
62+
/// diagnostic should be used in all supported locations.
63+
/// </summary>
64+
public static readonly TspVisibility All = new(true, true, true);
65+
6066
/// <summary>
6167
/// True if the message should be displayed on the status page (defaults to false).
6268
/// </summary>
@@ -166,7 +172,7 @@ public DiagnosticMessage(
166172
this.HelpLinks = new List<string>();
167173
this.Attributes = new Dictionary<string, object>();
168174
this.Severity = severity;
169-
this.Visibility = visibility ?? new TspVisibility(statusPage: true);
175+
this.Visibility = visibility ?? TspVisibility.All;
170176
this.Location = location ?? new TspLocation();
171177
this.Internal = intrnl ?? false;
172178
this.MarkdownMessage = markdownMessage;

csharp/ql/integration-tests/all-platforms/diag_dotnet_incompatible/diagnostics.expected

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
"name": "Some projects are incompatible with .NET Core"
1212
},
1313
"visibility": {
14-
"statusPage": true
14+
"cliSummaryTable": true,
15+
"statusPage": true,
16+
"telemetry": true
1517
}
1618
}
1719
{
@@ -27,6 +29,8 @@
2729
"name": "Some projects or solutions failed to build using MSBuild"
2830
},
2931
"visibility": {
30-
"statusPage": true
32+
"cliSummaryTable": true,
33+
"statusPage": true,
34+
"telemetry": true
3135
}
3236
}

csharp/ql/integration-tests/all-platforms/diag_missing_project_files/diagnostics.expected

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
"name": "Some projects or solutions failed to build using MSBuild"
1212
},
1313
"visibility": {
14-
"statusPage": true
14+
"cliSummaryTable": true,
15+
"statusPage": true,
16+
"telemetry": true
1517
}
1618
}
1719
{
@@ -27,6 +29,8 @@
2729
"name": "Missing project files"
2830
},
2931
"visibility": {
30-
"statusPage": true
32+
"cliSummaryTable": true,
33+
"statusPage": true,
34+
"telemetry": true
3135
}
3236
}

csharp/ql/integration-tests/all-platforms/diag_missing_xamarin_sdk/diagnostics.expected

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
"name": "Some projects or solutions failed to build using .NET Core"
1212
},
1313
"visibility": {
14-
"statusPage": true
14+
"cliSummaryTable": true,
15+
"statusPage": true,
16+
"telemetry": true
1517
}
1618
}
1719
{
@@ -27,7 +29,9 @@
2729
"name": "Some projects or solutions failed to build using MSBuild"
2830
},
2931
"visibility": {
30-
"statusPage": true
32+
"cliSummaryTable": true,
33+
"statusPage": true,
34+
"telemetry": true
3135
}
3236
}
3337
{
@@ -43,6 +47,8 @@
4347
"name": "Missing Xamarin SDK for iOS"
4448
},
4549
"visibility": {
46-
"statusPage": true
50+
"cliSummaryTable": true,
51+
"statusPage": true,
52+
"telemetry": true
4753
}
4854
}

csharp/ql/integration-tests/posix-only/diag_autobuild_script/diagnostics.expected

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
"name": "Unable to build project using build script"
1212
},
1313
"visibility": {
14-
"statusPage": true
14+
"cliSummaryTable": true,
15+
"statusPage": true,
16+
"telemetry": true
1517
}
1618
}
1719
{
@@ -27,6 +29,8 @@
2729
"name": "No project or solutions files found"
2830
},
2931
"visibility": {
30-
"statusPage": true
32+
"cliSummaryTable": true,
33+
"statusPage": true,
34+
"telemetry": true
3135
}
3236
}

csharp/ql/integration-tests/posix-only/diag_multiple_scripts/diagnostics.expected

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
"name": "No project or solutions files found"
1212
},
1313
"visibility": {
14-
"statusPage": true
14+
"cliSummaryTable": true,
15+
"statusPage": true,
16+
"telemetry": true
1517
}
1618
}
1719
{
@@ -27,6 +29,8 @@
2729
"name": "There are multiple potential build scripts"
2830
},
2931
"visibility": {
30-
"statusPage": true
32+
"cliSummaryTable": true,
33+
"statusPage": true,
34+
"telemetry": true
3135
}
3236
}

csharp/ql/integration-tests/windows-only/diag_autobuild_script/diagnostics.expected

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
"name": "Unable to build project using build script"
1212
},
1313
"visibility": {
14-
"statusPage": true
14+
"cliSummaryTable": true,
15+
"statusPage": true,
16+
"telemetry": true
1517
}
1618
}
1719
{
@@ -27,6 +29,8 @@
2729
"name": "No project or solutions files found"
2830
},
2931
"visibility": {
30-
"statusPage": true
32+
"cliSummaryTable": true,
33+
"statusPage": true,
34+
"telemetry": true
3135
}
3236
}

csharp/ql/integration-tests/windows-only/diag_multiple_scripts/diagnostics.expected

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
"name": "No project or solutions files found"
1212
},
1313
"visibility": {
14-
"statusPage": true
14+
"cliSummaryTable": true,
15+
"statusPage": true,
16+
"telemetry": true
1517
}
1618
}
1719
{
@@ -27,6 +29,8 @@
2729
"name": "There are multiple potential build scripts"
2830
},
2931
"visibility": {
30-
"statusPage": true
32+
"cliSummaryTable": true,
33+
"statusPage": true,
34+
"telemetry": true
3135
}
3236
}

0 commit comments

Comments
 (0)