Aqua.jl icon indicating copy to clipboard operation
Aqua.jl copied to clipboard

Test if all exported names has a docstring

Open Roger-luo opened this issue 3 years ago • 10 comments

we have some facilities testing this here: https://github.com/QuEraComputing/Bloqade.jl/pull/470/files#diff-8b6a3d1fcb6507d7155106fb9cbecf22d4b3b1377f4128af77b2112c2277e0a7R4

might be a good test for everyone in general? what do people think?

Roger-luo avatar Dec 09 '22 19:12 Roger-luo

just a friendly thumbs up, as I think this would be very nice to have :)

lucaferranti avatar Dec 28 '22 13:12 lucaferranti

Not quite sure if this is exactly what you're looking for, but Documenter also allows to check for existing docstrings. See this PR: https://github.com/JuliaDocs/Documenter.jl/pull/1995 in particular.

KeithWM avatar Apr 28 '23 08:04 KeithWM

Not quite sure if this is exactly what you're looking for, but Documenter also allows to check for existing docstrings.

Indeed but some packages don't have a Documenter page (for instance because the README is very good). Still, they might want to add quality checks with Aqua, and this is an important one in my opinion :)

gdalle avatar Jun 11 '23 10:06 gdalle

Even then, it might be wise for Aqua to use or borrow the implementation of Documenter rather than reinventing the wheel. That said, there is a question whether Aqua attempts to be a one-stop quality assurance package, or play alongside other quality checks. What goes for Documenter's tests on documentation could also be said for JET's type stability checks. And maybe for other packages in this area too.

KeithWM avatar Jun 17 '23 12:06 KeithWM

hasdoc will be added in Base.

https://github.com/JuliaLang/julia/issues/51174

hyrodium avatar Nov 13 '23 15:11 hyrodium

This is now as simple as:

 @test isempty(Docs.undocumented_names(MyModule))

in Julia 1.11.

(Note that this checks all public names, not just exported, i.e. it includes identifiers declared with the new public keyword in addition to identifiers declared with export.)

stevengj avatar Jan 19 '24 20:01 stevengj

Just because it's a one liner perhaps doesn't mean it shouldn't be part of Aqua?

gdalle avatar Jan 24 '24 06:01 gdalle

I just wanted to open an issue on this and found this one. I think it should be part of Aqua, to make it a real one-stop solution for these quality tests.

j-fu avatar Mar 22 '24 10:03 j-fu

I move to reopen as well

gdalle avatar Mar 22 '24 10:03 gdalle