A tool to check documentation of functions?

Hello,

I am looking for a tool to report all exported functions with missing @doc in a project.

So far I have found:

  • Inch - I have not been able to use it since several Elixir minor versions.
  • Credo - It is useful for many things and missing @spec but I am not sure if there is a way to report missing @doc attributes. Maybe that could be a proposal.
  • Doctor - It does not report what functions are missing, and reports functions even it there is @moduledoc false in the module, which does not work quite well with my workflow.

Does anyone knows another tool that could do what I want?

Bonus point if it reports missing @doc on @callback declarations!.

Otherwise I will see if a custom credo check is possible…

1 Like

I am AFK but 99% sure credo has this.

1 Like

I’m looking at the docs now. I see it for moduledocs:

https://hexdocs.pm/credo/Credo.Check.Readability.ModuleDoc.html#content

But I don’t see it for other kinds of documentation. I could just be missing it or it could be under a name I’m not expecting.

1 Like

Thats what I was thinking of. :thinking:

I was wrong. It is not available in credo. Proposal: Have a check for undocumented Public functions · Issue #18 · rrrene/credo-proposals · GitHub

Sorry for the noise.

1 Like

I know that a lot of folk build their own custom credo checks, maybe you could do that too.

Here is a official guideline from credo repo on how to build your own custom check: credo/guides/custom_checks/adding_checks.md at master · rrrene/credo · GitHub

1 Like

I thought of Archeometer v0.5.0 — Documentation but it doesn’t seem to collect information on docs availability. Probably could be added though.

1 Like

I updated the issue on the credo repo. If a macro-aware way was found for moduledocs it can be done for doc as well I guess.

3 Likes