File tree 2 files changed +19
-5
lines changed
2 files changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -105,9 +105,6 @@ const processHintResults = async (scanResult) => {
105
105
version : scanResult . webhintVersion
106
106
} ) ;
107
107
108
- result . removeCategory ( 'other' ) ;
109
- result . removeCategory ( 'development' ) ;
110
-
111
108
result . showError = hints . every ( ( hint ) => {
112
109
return hint . messages . length === 1 && hint . messages [ 0 ] . message === 'Error in webhint analyzing this hint' ;
113
110
} ) ;
@@ -125,6 +122,25 @@ const processHintResults = async (scanResult) => {
125
122
}
126
123
} ) ;
127
124
125
+ const categoriesToRemove = [ ] ;
126
+
127
+ for ( const category of result . categories ) {
128
+ const passedCount = category . passed ? category . passed . length : 0 ;
129
+ const hintsCount = category . hints ? category . hints . length : 0 ;
130
+
131
+ /*
132
+ * If there is no hints in the category, add the category
133
+ * to the list of categories to remove.
134
+ */
135
+ if ( passedCount + hintsCount === 0 ) {
136
+ categoriesToRemove . push ( category . name . toLowerCase ( ) ) ;
137
+ }
138
+ }
139
+
140
+ for ( const category of categoriesToRemove ) {
141
+ result . removeCategory ( category ) ;
142
+ }
143
+
128
144
result . id = scanResult . id ;
129
145
result . permalink = `${ webhintUrl } scanner/${ scanResult . id } ` ;
130
146
Original file line number Diff line number Diff line change 205
205
updateAsPass ( category ) ;
206
206
}
207
207
208
- filterNewUpdates ( category ) ;
209
-
210
208
category . hintsToUpdate = filterNewUpdates ( category ) ;
211
209
212
210
updateErrorItems ( category ) ;
You can’t perform that action at this time.
0 commit comments