Mix Tasks: @shortdoc and @moduledoc

While I was writing a new mix task, I discovered that both @shortdoc and @moduledoc are necessary for the task to be listed in mix help.

I was a bit surprised, this didn’t seem like a hard requirement as per the Mix.Task documentation.

I ended up writing my findings on my blog.

Did anybody else run into this? Did I miss something documentation-wise? Or would the documentation benefit from a clarification?

1 Like

We were wondering why our tasks weren’t listed in mix help anymore. I wonder if this was an intended change.

1 Like

Guys, please feel free to open up an issue.
I haven’t had the time to look into the issue. but by the look of it, it should either be fixed, documented, or both.

Mix tasks have always behave like this. It is mentioned in the docs:

Define the @shortdoc attribute if you wish to make the task publicly visible on mix help. Omit this attribute if you do not want your task to be listed via mix help.

:slight_smile:

1 Like

Before it was enough to define the @shortdoc, now we need to define both @shortdoc and @moduledoc.
At least that’s what we’re seeing.

1 Like

Oh, I see. Yes, please open up an issue then!

Edit 1: now I see I misread the whole thread. The issue is exactly about both being required. Apologies!

Edit 2: This has been fixed in upcoming v1.13.

9 Likes