JuliaTesting / Aqua.jl

Auto QUality Assurance for Julia packages
MIT License
335 stars 24 forks source link

Test if all exported names has a docstring #90

Open Roger-luo opened 1 year ago

Roger-luo commented 1 year ago

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?

lucaferranti commented 1 year ago

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

KeithWM commented 1 year ago

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.

gdalle commented 1 year ago

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

KeithWM commented 1 year ago

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.

hyrodium commented 10 months ago

hasdoc will be added in Base.

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

stevengj commented 7 months ago

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

gdalle commented 7 months ago

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

j-fu commented 5 months ago

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.

gdalle commented 5 months ago

I move to reopen as well