Skip to content

Commit bd015f1

Browse files
Tim Blasikegluneq
authored andcommitted
build(dartanalyzer): Ignore TODOs during build
The newest version of the analyzer emits hints when it encounters TODOs in code, which is breaking the Dart dev version of our build. Ignore TODOs for the purpose of build health. See angular#6410
1 parent ca7ba12 commit bd015f1

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

tools/build/dartanalyzer.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,16 +165,17 @@ _AnalyzerOutputLine.prototype = {
165165
lineText =
166166
'\n' + sourceLine + '\n' + repeat(' ', this.colNum) + repeat('^', this.asciiLineLength);
167167
}
168-
return '[' + this.severity + '] ' + this.errorMsg + ' (' + this.sourcePath + ', line ' +
169-
this.lineNum + ', col ' + this.colNum + ')' + lineText;
168+
return '[' + this.severity + '] type: ' + this.errorType + ' ' +
169+
this.errorMsg + ' (' + this.sourcePath + ', line ' + this.lineNum +
170+
', col ' + this.colNum + ')' + lineText;
170171
},
171172

172173
shouldIgnore: function() {
173174
if (this.errorCode.match(/UNUSED_IMPORT/i)) {
174175
if (this.sourcePath.match(/_analyzer\.dart/)) {
175176
return true;
176177
}
177-
// TODO remove it once ts2dart propertly generates abstract getters
178+
// TODO remove it once ts2dart properly generates abstract getters
178179
if (this.errorMsg.match(/unimplemented/)) {
179180
return true;
180181
}
@@ -189,6 +190,11 @@ _AnalyzerOutputLine.prototype = {
189190
return true;
190191
}
191192

193+
// TODOs shouldn't break our build...
194+
if (this.errorCode.match(/TODO/i)) {
195+
return true;
196+
}
197+
192198
// Don't worry about hints in generated files.
193199
if (this.isHint && this.sourcePath.match(/generated/i)) {
194200
return true;

0 commit comments

Comments
 (0)