Skip to content

add a --no-generate-docs flag that is faster and only displays warnings #1909

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 8 commits into from
Jan 23, 2019

Conversation

jcollins-g
Copy link
Contributor

@jcollins-g jcollins-g commented Jan 22, 2019

Fixes #1537.

Allows the user to use dartdoc to show dartdoc errors and warnings only without actually generating documentation.

Also has some changes to output in the common case.

Without --no-generate-docs:

~/dart/dartdoc
$ dart bin/dartdoc.dart
Documenting dartdoc...
parsing /usr/local/google/home/jcollins/dart/dartdoc/lib/dartdoc.dart...
parsing /usr/local/google/home/jcollins/dart/all_sdks/2.1.1-dev.1.0/lib/async/async.dart...
parsing /usr/local/google/home/jcollins/dart/all_sdks/2.1.1-dev.1.0/lib/collection/collection.dart...

[...]
parsing /usr/local/google/home/jcollins/.pub-cache/hosted/pub.dartlang.org/matcher-0.12.3+1/lib/mirror_matchers.dart...
Initialized dartdoc with 668 libraries in 47.0 seconds
documenting dartdoc
Generating docs for library dartdoc from package:dartdoc/dartdoc.dart...
  warning: unresolved doc reference [Property], from dartdoc.TopLevelContainer: (file:///usr/local/google/home/jcollins/dart/dartdoc/lib/src/model.dart:5464:16)
  warning: unresolved doc reference [_MarkdownCommentReference._getResultsForClass]
    from dartdoc.Accessor.namePart: (file:///usr/local/google/home/jcollins/dart/dartdoc/lib/src/model.dart)
    in documentation inherited from dartdoc.models.Nameable.namePart: (file:///usr/local/google/home/jcollins/dart/dartdoc/lib/src/model.dart:4548:14)
  warning: unresolved doc reference [_MarkdownCommentReference._getResultsForClass]
    from dartdoc.Class.allModelElementsByNamePart: (file:///usr/local/google/home/jcollins/dart/dartdoc/lib/src/model.dart)
    in documentation inherited from dartdoc.Class.allModelElementsByNamePart: (file:///usr/local/google/home/jcollins/dart/dartdoc/lib/src/model.dart:681:39)
  warning: unresolved doc reference [_MarkdownCommentReference._getResultsForClass]
    from dartdoc.Nameable.namePart: (file:///usr/local/google/home/jcollins/dart/dartdoc/lib/src/model.dart)
    in documentation inherited from dartdoc.Nameable.namePart: (file:///usr/local/google/home/jcollins/dart/dartdoc/lib/src/model.dart:4548:14)
  warning: unresolved doc reference [config.autoIncludeDependencies]
    from dartdoc.Package.isLocal: (file:///usr/local/google/home/jcollins/dart/dartdoc/lib/src/model.dart)
    in documentation inherited from dartdoc.Package.isLocal: (file:///usr/local/google/home/jcollins/dart/dartdoc/lib/src/model.dart:5889:12)
  warning: unresolved doc reference [toolPath]
    from dartdoc.Snapshot.needsSnapshot: (file:///usr/local/google/home/jcollins/dart/dartdoc/lib/src/dartdoc_options.dart)
    in documentation inherited from dartdoc.Snapshot.needsSnapshot: (file:///usr/local/google/home/jcollins/dart/dartdoc/lib/src/dartdoc_options.dart:209:12)
Validating docs...
found 6 warnings and 0 errors
Documented 1 public library in 7.6 seconds
Success! Docs generated into /usr/local/google/home/jcollins/dart/dartdoc/doc/api

With --no-generate-docs:

~/dart/dartdoc
$ dart bin/dartdoc.dart --no-generate-docs
Documenting dartdoc...
  warning: unresolved doc reference [_MarkdownCommentReference._getResultsForClass]
    from dartdoc.Accessor.namePart: (file:///usr/local/google/home/jcollins/dart/dartdoc/lib/src/model.dart)
    in documentation inherited from dartdoc.models.Nameable.namePart: (file:///usr/local/google/home/jcollins/dart/dartdoc/lib/src/model.dart:4548:14)
  warning: unresolved doc reference [_MarkdownCommentReference._getResultsForClass]
    from dartdoc.Nameable.namePart: (file:///usr/local/google/home/jcollins/dart/dartdoc/lib/src/model.dart)
    in documentation inherited from dartdoc.Nameable.namePart: (file:///usr/local/google/home/jcollins/dart/dartdoc/lib/src/model.dart:4548:14)
  warning: unresolved doc reference [_MarkdownCommentReference._getResultsForClass]
    from dartdoc.Class.allModelElementsByNamePart: (file:///usr/local/google/home/jcollins/dart/dartdoc/lib/src/model.dart)
    in documentation inherited from dartdoc.Class.allModelElementsByNamePart: (file:///usr/local/google/home/jcollins/dart/dartdoc/lib/src/model.dart:681:39)
  warning: unresolved doc reference [config.autoIncludeDependencies]
    from dartdoc.Package.isLocal: (file:///usr/local/google/home/jcollins/dart/dartdoc/lib/src/model.dart)
    in documentation inherited from dartdoc.Package.isLocal: (file:///usr/local/google/home/jcollins/dart/dartdoc/lib/src/model.dart:5889:12)
  warning: unresolved doc reference [toolPath]
    from dartdoc.Snapshot.needsSnapshot: (file:///usr/local/google/home/jcollins/dart/dartdoc/lib/src/dartdoc_options.dart)
    in documentation inherited from dartdoc.Snapshot.needsSnapshot: (file:///usr/local/google/home/jcollins/dart/dartdoc/lib/src/dartdoc_options.dart:209:12)
  warning: unresolved doc reference [Property], from dartdoc.TopLevelContainer: (file:///usr/local/google/home/jcollins/dart/dartdoc/lib/src/model.dart:5464:16)
found 6 warnings and 0 errors

@googlebot googlebot added the cla: yes Google CLA check succeeded. label Jan 22, 2019
@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 93.909% when pulling 5398d6a on allow-non-writing into 737755a on master.

@jcollins-g jcollins-g changed the title WIP: add a --no-generate-docs flag that is faster and only displays warnings add a --no-generate-docs flag that is faster and only displays warnings Jan 23, 2019
@jcollins-g jcollins-g requested review from pq and kevmoo January 23, 2019 00:39
writingProgress = true;
stdout.write(message);
} else {
print(message);
Copy link
Member

Choose a reason for hiding this comment

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

should this use stdout too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This code is making use of the side-effect of print that adds a \n.

@kevmoo
Copy link
Member

kevmoo commented Jan 23, 2019

@jcollins-g – any particular thing you want me to look at?

@jcollins-g
Copy link
Contributor Author

@kevmoo I mostly put you on the list as you said you had an implementation of this in #1537 and so might be interested.

@jcollins-g jcollins-g merged commit 6ec18b5 into master Jan 23, 2019
@jcollins-g jcollins-g deleted the allow-non-writing branch January 23, 2019 14:25
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.

Allow running without generating files – just to see errors
5 participants