Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False negative with Credo.Check.Readability.ModuleDoc in nested modules #1168

Closed
idkCpp opened this issue Dec 13, 2024 · 3 comments
Closed

Comments

@idkCpp
Copy link

idkCpp commented Dec 13, 2024

Environment

  • Credo version (mix credo -v): 1.7.10
  • Erlang/Elixir version (elixir -v): Elixir 1.17.3 (compiled with Erlang/OTP 27)
  • Operating system: Linux

What were you trying to do?

When having nested module definitions, an inner module having @moduledoc will silence the credo check for the outer module.

Consider the following code:

defmodule Foo do
  # distinctly no moduledoc here
  defmodule Bar do
    @moduledoc false
  end
end

Expected outcome

  Code Readability                                                              
┃ 
┃ [R] → Modules should have a @moduledoc tag.
┃       example.ex:1:11 #(Foo)

Actual outcome

found no issues.

@rrrene
Copy link
Owner

rrrene commented Dec 13, 2024

Thx for reporting! 👍 I added a test reproducing this 👍

rrrene added a commit that referenced this issue Dec 15, 2024
@rrrene
Copy link
Owner

rrrene commented Dec 15, 2024

Thanks for reporting this 😀 It is now fixed on master.

You can try this by setting the Credo dep to

{:credo, github: "rrrene/credo"}

Please report back if your issue is solved! 👍

@idkCpp
Copy link
Author

idkCpp commented Dec 16, 2024

I can confirm it to be working.

Many thanks for your time and effort. And thank you for this helpful project!

@idkCpp idkCpp closed this as completed Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants