dartdoc
dartdoc copied to clipboard
Dartdoc reports success when nothing was documented
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)