Skip to content

dartdoc_checker throws assert re: html extension #64103

@srawlins

Description

@srawlins

When I run ./dev/bots/docs.sh, I get the following crash:

Unhandled exception:
'file:///Users/srawlins/code/flutter/dev/tools/dartdoc_checker.dart': Failed assertion: line 87 pos 10: 'path.extension(file.path) == 'html'': Scanned file is not HTML: "dev/docs/doc/api/dart-convert/Latin1Codec/encoder.html"; (.html)
#0      _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:46:39)
#1      _AssertionError._throwNew (dart:core-patch/errors_patch.dart:36:5)
#2      _scanFile (file:///Users/srawlins/code/flutter/dev/tools/dartdoc_checker.dart:87:10)
#3      checkForUnresolvedDirectives (file:///Users/srawlins/code/flutter/dev/tools/dartdoc_checker.dart:65:16)
#4      main (file:///Users/srawlins/code/flutter/dev/tools/dartdoc.dart:231:3)
<asynchronous suspension>
#5      _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:299:32)
#6      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)

(I'd added a few comment lines, so the line numbers may be offset)

https://github.com/flutter/flutter/blob/7f122c7429264088adcba73122c4aa69005f9f3a/dev/tools/dartdoc_checker.dart#L52..L87

You can see that the assert checks against 'html', but above, on line 55, we're only checking files with extensions equal to '.html (note the dot).

Metadata

Metadata

Assignees

Labels

team-infraOwned by Infrastructure team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions