-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Support filtering mix deps output
#15009
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
Conversation
lib/mix/lib/mix/tasks/deps.ex
Outdated
| This is particularly useful when you need to quickly check versions for | ||
| bug reports or similar tasks. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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:
elixir/lib/mix/lib/mix/tasks/deps.ex
Lines 185 to 189 in b60e424
| 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:
elixir/lib/mix/lib/mix/tasks/archive.uninstall.ex
Lines 15 to 18 in b60e424
## Command line options * `--force` - forces uninstallation without a shell prompt; primarily intended for automation """ elixir/lib/mix/lib/mix/tasks/escript.uninstall.ex
Lines 15 to 18 in b60e424
## Command line options * `--force` - forces uninstallation without a shell prompt; primarily intended for automation """ elixir/lib/mix/lib/mix/tasks/release.init.ex
Lines 10 to 18 in b60e424
@moduledoc """ Generates sample files for releases. $ mix release.init * creating rel/vm.args.eex * creating rel/remote.vm.args.eex * creating rel/env.sh.eex * creating rel/env.bat.eex """
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.
There was a problem hiding this comment.
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.
b759cd4 to
6bc3cf7
Compare
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
6bc3cf7 to
0b98708
Compare
|
| end | ||
| end | ||
|
|
||
| defp receive_shell_messages(acc \\ []) do |
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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.
elixir/lib/mix/test/mix/tasks/xref_test.exs
Lines 1338 to 1344 in bd909cb
| 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! 💜
|
💚 💙 💜 💛 ❤️ |
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