You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
credo prints messages about too many module dependencies that are expected. Unfortunately I'm unable to exclude them (as I can only exclude file path or whole module having many dependencies). I would like to check if except said group my module does not have too much dependencies.
The argument for it is to work with a group of sub-modules (modules in same namespace) instead of single and huge one. In my case there are 8 sub-modules, so I don't need a lot of effort to cause credo's message. I'm working on custom DSL (think about Ecto.Schema) and either I have a huge module with many dependencies or I split it based on features (like each DSL macro).
I would like to check if except said group my module does not have too much dependencies.
Okay, for my understanding: You have a module - let's call it Foo.API that reaches out in many other modules, but this is by design. Like Ecto.Schema it is sort of a fascade for the other module's functionalities. And now you would like to be able to tell the check: "Tell me if Foo.API is reaching out into too many other modules, but ignore a given list of modules, because it is supposed to reach out into these modules."
credo
prints messages about too many module dependencies that are expected. Unfortunately I'm unable to exclude them (as I can only exclude file path or whole module having many dependencies). I would like to check if except said group my module does not have too much dependencies.The argument for it is to work with a group of sub-modules (modules in same namespace) instead of single and huge one. In my case there are 8 sub-modules, so I don't need a lot of effort to cause
credo
's message. I'm working on custom DSL (think aboutEcto.Schema
) and either I have a huge module with many dependencies or I split it based on features (like each DSL macro).I think about support for 3rd argument in below code:
https://github.com/rrrene/credo/blob/91502cec785f8a12633851384d6ec83c0c549d39/lib/credo/check/refactor/module_dependencies.ex#L87
and add
reject_namespaces/2
like:Current workaround is to put below line at the start of file defining module with many dependencies:
# credo:disable-for-this-file Credo.Check.Refactor.ModuleDependencies
This feature should be simple to implement and I think it would be very helpful. What do you think about it?
The text was updated successfully, but these errors were encountered: