Skip to content

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

Merged
merged 29 commits into from
Apr 11, 2018

Conversation

jcollins-g
Copy link
Contributor

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).

@googlebot googlebot added the cla: yes Google CLA check succeeded. label Apr 10, 2018
@jcollins-g jcollins-g requested review from devoncarew and pq April 10, 2018 16:21
@jcollins-g jcollins-g requested a review from keertip April 10, 2018 16:30
Copy link
Member

@pq pq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -49,9 +54,15 @@ abstract class PackageMeta {
factory PackageMeta.fromDir(Directory dir) {
Directory original = dir.absolute;
dir = original;
if (!original.existsSync()) {
throw PackageMetaFailure(
Copy link
Member

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.)

Copy link
Member

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/ DartDocFailures.

Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Google CLA check succeeded.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants