-
Notifications
You must be signed in to change notification settings - Fork 125
Refactor DartDocConfig object usage, part 2 #1662
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…rtdoc tests for travis
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
lib/src/package_meta.dart
Outdated
@@ -49,9 +54,15 @@ abstract class PackageMeta { | |||
factory PackageMeta.fromDir(Directory dir) { | |||
Directory original = dir.absolute; | |||
dir = original; | |||
if (!original.existsSync()) { | |||
throw PackageMetaFailure( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you meaning to elide the optional new
here? (If so, curious if there's a rationale for when you do and don't.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Actually, maybe you're doing this for exceptions? I notice the same pattern above w/ DartDocFailure
s.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The analyzer just doesn't seem to warn about this case regardless of whether previewDart2 is enabled. Fixed.
This continues #1661 by moving the generator construction out of bin/dartdoc.dart, and allowing clients to use a factory to instantiate them (progress toward #1609). Next PR in this series will handle moving the sdkDir configuration (#1617).