D-Scanner icon indicating copy to clipboard operation
D-Scanner copied to clipboard

std/int128.d(19:15)[warn]: Public declaration 'Int128' has no documented example

Open WalterBright opened this issue 3 years ago • 4 comments

I tried a documented example:

  1. embedded in the documentation for the struct
  2. as a member of the struct
  3. following the closing brace of the struct

I have no idea what dscanner wants.

WalterBright avatar Apr 14 '22 07:04 WalterBright

Example:

https://github.com/dlang/phobos/pull/8426

WalterBright avatar Apr 14 '22 07:04 WalterBright

File that does the analysis: https://github.com/dlang-community/D-Scanner/blob/2963358eb4a24064b0893493684d4075361297eb/src/dscanner/analysis/has_public_example.d

The problem is probably the version block being before the unittest (I'm guessing).

rikkimax avatar Apr 14 '22 07:04 rikkimax

the D-Scanner check seems to be correct. There is no public example for the Int128 struct in the generated ddoc page using dmd -D

missing example code screenshot

Moving the documented unittest right after the closing brace of the struct makes it appear in the documentation and also makes D-Scanner not emit any error.

WebFreak001 avatar Apr 14 '22 13:04 WebFreak001

I suggest that the documentation for Dscanner have, for everything checked, an example of what passing it looks like. I also recommend that the Dscanner executable be included with the dmd distribution.

WalterBright avatar Apr 14 '22 23:04 WalterBright