How to remove waring "Modules should have a @moduledoc tag" - mix credo -a

I am using mix credo -a to check code readably. But I am getting multiple message as “Modules should have a @moduledoc tag.” I am not sure how to suppress/remove this.
Thanks in advance for any kind of help.

Sometimes when you are not sure about how to solve an issue, you can use mix credo explain, and it will tell you something about the suggestion and how to resolve it.

The simplest way though to solve your issue at hand is, to simply document the modules that have this issue: @moduledoc

1 Like

Thanks @NobbZ for your help. I’ll try this and hope this will solve my issue.

1 Like

Or you could just document your modules :wink:

3 Likes

Yes, that seems to be the actual reason of this warning. :slight_smile: Thanks.

That command alone will not solve anything, its just that it might give you some more in depth explanation of an issue.

To solve the actual issue, you need to use @moduledoc do document your modules, as I already said earlier.

1 Like

You can add @moduledoc false and credo will skip the module’s documentation, not showing the warning.

2 Likes

This will also specifically prevent the module from even being listed in generation documentation and some other lookups as well.

3 Likes