dlang-community / D-Scanner

Swiss-army knife for D source code
Boost Software License 1.0
238 stars 80 forks source link

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

Open WalterBright opened 2 years ago

WalterBright commented 2 years ago

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 commented 2 years ago

Example:

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

rikkimax commented 2 years ago

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).

WebFreak001 commented 2 years ago

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.

WalterBright commented 2 years ago

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.