dartdoc icon indicating copy to clipboard operation
dartdoc copied to clipboard

Dartdoc reports success when nothing was documented

Open mit-mit opened this issue 4 years ago • 0 comments

If you run dartdoc on something that doesn't have a lib/ directory you get this:

$ ~/sdk/dart/2.15.0/bin/dartdoc
Documenting test1...
  warning: package:test1 has no documentable libraries
    from package-test1: file:///Users/mit/tmp/test1
            Dartdoc could not find any public libraries to document in package:test1,
            but documentation was requested.  This might be expected for an
            asset only package, in which case, disable this warning in your
            dartdoc_options.yaml file.
Initialized dartdoc with 0 libraries in 10.9 seconds
Validating docs...
Found 1 warning and 0 errors.
Documented 0 public libraries in 0.2 seconds
dartdoc could not find any libraries to document
Success! Docs generated into /Users/mit/tmp/test1/doc/api

$ echo $?
0

I find a bit odd that we print both "warning" and "Success!". And shouldn't we return something like 126 for a case like this? (https://tldp.org/LDP/abs/html/exitcodes.html)

mit-mit avatar Jan 20 '22 11:01 mit-mit