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
Hi, something I spotted when trying to run on one of my toy projects:
I'm using gen_state_machine and depending on a module variant I pass to my machine it uses different logic.
mix_unused catches all my defstruct definitions and delegates as unused:
defdelegate fetch(term, key), to: Map
defdelegate get(term, key, default), to: Map
defdelegate get_and_update(term, key, fun), to: Map
defstruct @valid_moves
hint: %Score{} is unused
lib/variants/score.ex:110
hint: Score.fetch/2 is unused
lib/variants/score.ex:107
hint: Score.get/3 is unused
lib/variants/score.ex:108
hint: Score.get_and_update/3 is unused
lib/variants/score.ex:109
The text was updated successfully, but these errors were encountered:
Struct should be properly detected if it is used anywhere in the codebase, so simple %Score{} should be detected as usage of struct.
I can check if it is possible to extract the fact that it is defdelegate and then set it in metadata, so it should be then possible to filter using that on user end.
defdelegate is often used in larger projects (which would benefit most from mix_unused). so would be really valuable to have defdelegate supported in a future version.
Hi, something I spotted when trying to run on one of my toy projects:
I'm using gen_state_machine and depending on a module variant I pass to my machine it uses different logic.
mix_unused catches all my defstruct definitions and delegates as unused:
The text was updated successfully, but these errors were encountered: