On Tuesday, 1 June 2021 at 04:28:48 UTC-4 José Valim wrote:

> Those all look great!
>
> 1. Correct! We have recently changed --label compile so it considers 
> transient dependencies, before it would only consider direct ones. I can 
> think of two options here. One potential option here is to introduce a new 
> label, called "--label transient-compile". Would that be feasible 
> implementation wise?
>

I'm not completely sure what you are thinking about, in particular with 
that name as `--label compile` currently does show "transient compile" 
deps, unless one uses `--only-direct`.
Would `--label transient-compile` filter out all dependencies that are 
either not compile time, or those that are compile-time but towards a sink 
with no dependency? 
E.g.:  A => B (runtime) => C (compile) => D (anything): clearly `B => C` 
needs to be selected, but would `A => B` also be selected (unless 
`--only-direct` is specified)?
 

> If we go this route, I would probably rename --only-direct to --label 
> direct-compile (of course, in a separate PR which I can also tackle).
>

Still confused. What I read is renaming `--label compile --only-direct` to 
`--label direct-compile`, having a new option `--label transient-compile` 
to show transient-but-not-dead-end-deps, and `--label compile` would remain 
for transient (dead-end or not) deps?

2. The option `--only-nodes` can be nice, but often I wanted the reverse
>
> --only-nodes is really only useful with the --sink option. I think we can 
> have two options here:
>
> a. Make --only-nodes show sinks unless the sink option is given
> b. Introduce a new option called --only-sinks (and then perhaps rename 
> --only-nodes to --only-sources
>

I lack experience to make an informed recommendation.

3. Sounds good to me! Our option parser even supports the :keep annotation, 
> so this should hopefully be straightforward!
>

Should be 👍

4. Which commands would you like to fail? Is there any command besides the 
> cycle one?
>

I'd say all formats too. For instance what I want in our CI is not about 
cycles, but stricter: no non-dead-end-compile deps at all.
`xref graph` is like a `grep`, so maybe a `--count` would output the number 
of dependencies found instead of the normal result, and have an exit code 
in consequence? With grep, no result == failure though, whereas here no 
result == success, could be confusing.

So maybe just `--test` that sets the result to a failure if anything is 
found. Or no option but that could lead to hard to figure out 
incompatibilities in some people's scripts.
 

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/2c14a96a-c950-4f91-b118-f3e8e6cc280bn%40googlegroups.com.

Reply via email to