Skip to content

Conversation

@rhcarvalho
Copy link
Contributor

Makes it easier to report versions of specific dependencies by allowing users (or tools) to pass dependency names as arguments to mix deps.

Warns when a dependency is not found, similar to mix deps.unlock.

Proposal: https://groups.google.com/g/elixir-lang-core/c/5tlLZ1yu4rQ/m/g7Z8fNWiBwAJ

This is particularly useful when you need to quickly check versions for
bug reports or similar tasks.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

Copy link
Contributor Author

@rhcarvalho rhcarvalho Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My chance to ask about an official stance on code style w.r.t. extra trailing empty lines on @moduledoc and @doc :)

I never found an explanation for that and find both styles and Elixir, Phoenix and other high profile projects.

Several tasks have a @moduledoc that has that extra empty line, and that includes the current implementation of deps.ex:

It supports the following options:
* `--all` - lists all dependencies, regardless of specified environment
"""

What's the thought process here? Is it add extra line after a bullet list, indented block, and/or something else?!

I looked through all the files under mix/tasks/ and bullet/block seems like the pattern, except for a few files that seem to be inconsistent with that:

If I inferred the pattern right, couldn't that be something that mix format takes care for us?

I'm sure missing nuance and historical context! Eager to learn.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t think j it matters much but you nailed it: no empty lines except at the end of lists.

Makes it easier to report versions of specific dependencies by allowing
users (or tools) to pass dependency names as arguments to `mix deps`.

Warns when a dependency is not found, similar to `mix deps.unlock`.

Proposal: https://groups.google.com/g/elixir-lang-core/c/5tlLZ1yu4rQ/m/g7Z8fNWiBwAJ
@rhcarvalho
Copy link
Contributor Author

  • Updated implementation to use @josevalim's suggestion based on Enum.flat_map/2 and Enum.find/2
  • Added input deduplication test
  • Revised documentation
  • Reverted to branch using explicit if (cases of defp action_or_different_action helpers are rare in the codebase)

end
end

defp receive_shell_messages(acc \\ []) do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use Process.info(self(), :messages) to get all messages, and then pattern matching on the list. It should lead to a cleaner test, I will rewrite that after merging!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to borrow from other tests, e.g.

defp receive_until_no_messages(acc) do
receive do
{:mix_shell, :info, [line]} -> receive_until_no_messages([acc, line | "\n"])
after
0 -> IO.iodata_to_binary(acc)
end
end

In case you want to look at them as a greater whole when rewriting!

Thanks for the review rounds! 💜

@josevalim josevalim merged commit 0435602 into elixir-lang:main Dec 14, 2025
11 checks passed
@josevalim
Copy link
Member

💚 💙 💜 💛 ❤️

@rhcarvalho rhcarvalho deleted the mix-deps-filter branch December 14, 2025 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants