Skip to content

Use PackageWarning system for multiple file overwrite errors #2111

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 2 commits into from
Jan 6, 2020

Conversation

jcollins-g
Copy link
Contributor

@jcollins-g jcollins-g commented Jan 4, 2020

Fixes #2110.

This removes the assert and replaces it with Dartdoc's warning system.

By defaulting to error type, this will show an error for the webdriver package, but Flutter already uses a flag to disable all errors in packages it depends on (which will also silence this error for them).

So after this gets published, webdriver will get a descriptive error message saying what is wrong, and everyone else can go about their business.

Example output:

Initialized dartdoc with 39 libraries in 14.8 seconds
documenting test_package_duplicate
Generating docs for library aDuplicate from package:test_package_duplicate/second.dart...
  warning: aDuplicate has no library level documentation comments, from aDuplicate: (file:///Users/jcollins/dart/dartdoc/testing/test_package_duplicate/lib/second.dart:1:9)
Generating docs for library aDuplicate from package:test_package_duplicate/first.dart...
  warning: aDuplicate has no library level documentation comments, from aDuplicate: (file:///Users/jcollins/dart/dartdoc/testing/test_package_duplicate/lib/first.dart:1:9)
  error: failed to write file at: aDuplicate/aDuplicate-library.html
    for symbol aDuplicate: (file:///Users/jcollins/dart/dartdoc/testing/test_package_duplicate/lib/first.dart:1:9)
    conflicting with file already generated by aDuplicate: (file:///Users/jcollins/dart/dartdoc/testing/test_package_duplicate/lib/second.dart:1:9)
            Dartdoc generates a path and filename to write to for each symbol.
            aDuplicate conflicts with another symbol in the generated path, and
            therefore can not be written out.  Changing the name, library name, or
            class name (if appropriate) of one of the conflicting items can resolve
            the conflict.   Alternatively, use the @nodoc tag in one symbol's
            documentation comments to hide it.
Validating docs...
found 2 warnings and 1 error
Documented 2 public libraries in 0.2 seconds

dartdoc failed: dartdoc encountered 1 errors while processing..
jcollins-macbookpro2:test_package_duplicate jcollins$

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

Coverage Status

Coverage decreased (-0.009%) to 93.93% when pulling 09a4e8b on assert-failure-multiple-files into 88ba99b on master.

@jcollins-g jcollins-g merged commit 285b4df into master Jan 6, 2020
@jcollins-g jcollins-g deleted the assert-failure-multiple-files branch April 27, 2020 20:40
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.

flutter throws assert for duplicate files now
4 participants