File tree Expand file tree Collapse file tree 3 files changed +10
-30
lines changed
DocumentationAnalyzers/DocumentationAnalyzers.Status.Generator Expand file tree Collapse file tree 3 files changed +10
-30
lines changed Original file line number Diff line number Diff line change @@ -28,12 +28,12 @@ public class DocumentationDiagnostic
28
28
public string Name { get ; set ; }
29
29
30
30
/// <summary>
31
- /// Gets or sets a value indicating whether the diagnostic is implemented .
31
+ /// Gets or sets the default diagnostic severity .
32
32
/// </summary>
33
33
/// <value>
34
- /// <see langword="true"/> if the diagnostic is implemented; otherwise <see langword="false"/> .
34
+ /// The default diagnostic severity .
35
35
/// </value>
36
- public bool HasImplementation { get ; set ; }
36
+ public string Severity { get ; set ; }
37
37
38
38
/// <summary>
39
39
/// Gets or sets a value indicating whether the diagnostic is enabled. This can indicate if the
Original file line number Diff line number Diff line change @@ -123,8 +123,6 @@ public async Task<ImmutableList<DocumentationDiagnostic>> GetDiagnosticsAsync()
123
123
continue ;
124
124
}
125
125
126
- bool hasImplementation = HasImplementation ( syntaxRoot ) ;
127
-
128
126
IEnumerable < DiagnosticDescriptor > descriptorInfos = GetDescriptor ( classSymbol ) ;
129
127
130
128
foreach ( var descriptorInfo in descriptorInfos )
@@ -140,7 +138,7 @@ public async Task<ImmutableList<DocumentationDiagnostic>> GetDiagnosticsAsync()
140
138
{
141
139
Id = descriptorInfo . Id ,
142
140
Category = descriptorInfo . Category ,
143
- HasImplementation = hasImplementation ,
141
+ Severity = descriptorInfo . DefaultSeverity . ToString ( ) ,
144
142
Status = status ,
145
143
Name = shortName ,
146
144
Title = descriptorInfo . Title . ToString ( ) ,
@@ -156,23 +154,6 @@ public async Task<ImmutableList<DocumentationDiagnostic>> GetDiagnosticsAsync()
156
154
return diagnostics . ToImmutable ( ) ;
157
155
}
158
156
159
- private static bool HasImplementation ( SyntaxNode syntaxRoot )
160
- {
161
- bool hasImplementation = true ;
162
- foreach ( var trivia in syntaxRoot . DescendantTrivia ( ) )
163
- {
164
- if ( trivia . IsKind ( SyntaxKind . SingleLineCommentTrivia ) )
165
- {
166
- if ( trivia . ToFullString ( ) . Contains ( "TODO: Implement analysis" ) )
167
- {
168
- hasImplementation = false ;
169
- }
170
- }
171
- }
172
-
173
- return hasImplementation ;
174
- }
175
-
176
157
private async Task InitializeAsync ( )
177
158
{
178
159
_solution = await _workspace . OpenSolutionAsync ( SlnPath ) . ConfigureAwait ( false ) ;
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ <h2>This page is reporting the current status of <a href="https://github.com/Dot
70
70
Title
71
71
</ td >
72
72
< td >
73
- Has Implementation
73
+ Severity
74
74
</ td >
75
75
< td >
76
76
Status
@@ -91,15 +91,11 @@ <h2>This page is reporting the current status of <a href="https://github.com/Dot
91
91
</ div >
92
92
93
93
< script id ="diagnostic-color " type ="text/x-jsrender ">
94
- { { if HasImplementation } }
95
94
{ { if Status !== "DisabledNoTests" } }
96
95
success
97
96
{ { else } }
98
97
warning
99
98
{ { / i f } }
100
- { { else } }
101
- danger
102
- { { / i f } }
103
99
</ script >
104
100
105
101
< script id ="diagnostic " type ="text/x-jsrender ">
@@ -114,7 +110,7 @@ <h2>This page is reporting the current status of <a href="https://github.com/Dot
114
110
{ { > Title} }
115
111
</ td >
116
112
< td >
117
- { { > HasImplementation } }
113
+ { { > Severity } }
118
114
</ td >
119
115
< td >
120
116
{ { > Status} }
@@ -173,7 +169,10 @@ <h3>Commit information</h3>
173
169
</ script >
174
170
175
171
< script type ="text/javascript ">
176
- $ . getJSON ( "https://ci.appveyor.com/api/projects/sharwell/Documentationanalyzers/artifacts/DocumentationAnalyzers.Status.json?branch=master&pr=false&stream=true&job=Configuration:%20Release" , function ( data ) {
172
+ var urlParams = new URLSearchParams ( window . location . search ) ;
173
+ var branch = urlParams . get ( 'branch' ) || 'master' ;
174
+ var pr = urlParams . get ( 'pr' ) === 'true' ? 'true' : 'false' ;
175
+ $ . getJSON ( `https://ci.appveyor.com/api/projects/sharwell/Documentationanalyzers/artifacts/DocumentationAnalyzers.Status.json?branch=${ branch } &pr=${ pr } &stream=true&job=Configuration:%20Release` , function ( data ) {
177
176
$ ( "#renderedDiagnostics" ) . html ( $ . templates ( $ ( "#diagnostics" ) . html ( ) ) . render ( data ) ) ;
178
177
$ ( "#renderedCommitInfo" ) . html ( $ . templates ( $ ( "#commitInfo" ) . html ( ) ) . render ( data . git ) ) ;
179
178
} ) ;
You can’t perform that action at this time.
0 commit comments