Skip to content

Conversation

@ruslandoga
Copy link
Contributor

Because copy-pasting the current example results in an error:

$ mix xref graph --format cycle
** (Mix) Unknown --format cycle in mix xref graph

But the "fix" works

$ mix xref graph --format cycles | head
119 cycles found. Showing them in decreasing size:

Cycle of length 45:

    extra/lib/plausible/stats/sampling.ex
    lib/plausible/stats/query.ex
    lib/plausible/stats/legacy/legacy_query_builder.ex
    lib/plausible/stats/metrics.ex
    extra/lib/plausible/stats/goal/revenue.ex
    lib/plausible/goal/schema.ex
Failed to write log message to stdout, trying stderr

00:04:58.920 [error] Writer crashed (:epipe)
** (ErlangError) Erlang error: :terminated
    (stdlib 6.0) io.erl:198: :io.put_chars(:standard_io, [[[], "    lib/plausible/auth/auth.ex"], 10])
    (mix 1.17.1) lib/mix/tasks/xref.ex:1073: anonymous fn/3 in Mix.Tasks.Xref.print_cycles/2
    (elixir 1.17.1) lib/enum.ex:2531: Enum."-reduce/3-lists^foldl/2-0-"/3
    (mix 1.17.1) lib/mix/tasks/xref.ex:1072: anonymous fn/3 in Mix.Tasks.Xref.print_cycles/2
    (elixir 1.17.1) lib/enum.ex:2531: Enum."-reduce/3-lists^foldl/2-0-"/3
    (mix 1.17.1) lib/mix/tasks/xref.ex:1069: anonymous fn/2 in Mix.Tasks.Xref.print_cycles/2
    (mix 1.17.1) lib/mix/tasks/xref.ex:1032: Mix.Tasks.Xref.with_digraph/2
    (mix 1.17.1) lib/mix/tasks/xref.ex:909: Mix.Tasks.Xref.write_graph/3

Hm. Maybe closing pipes should be handled more gracefully, but that's a separate issue :)

@whatyouhide whatyouhide changed the title fix typo in mix xref example Fix a typo in "mix xref" docs Dec 11, 2024
@whatyouhide
Copy link
Member

Great catch, thanks @ruslandoga 💟

@whatyouhide whatyouhide merged commit b0951f3 into elixir-lang:main Dec 11, 2024
8 of 9 checks passed
@ruslandoga ruslandoga deleted the patch-1 branch December 11, 2024 17:23
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.

2 participants