Re: [elixir-core:10755] [Proposal] dual alias of the same module should result in a warning

2022-02-03 Thread Jon Rowe
One of the same problems with `import` applies to `alias` too though, if a library has `alias Module` in its `use` macro it would cause this warning if you aliased it yourself to be explicit. Prehaps this is more suited to a static analysis tool like credo which already warns you if your

Re: [elixir-core:10754] Should this result in a warning?

2022-02-03 Thread Valter Sundström
Personally I feel the risk of a false positives is very low for this: > ^ *iex *> In how many other situations would you want a line starting with this, before a test, and not mean for it to be a doctest? I really struggle to come up with an example, but I might definitely have blind spots.

Re: [elixir-core:10754] [Proposal] dual alias of the same module should result in a warning

2022-02-03 Thread ku...@goyman.com
Yeah I agree that import is more tricky. But for me, alias is the main use case. I'll see if I can manage a PR. On Thursday, February 3, 2022 at 11:56:02 PM UTC+1 José Valim wrote: > We can warn it for aliases no problems and a PR would be welcome. > > However, for imports it is a bit more

Re: [elixir-core:10752] [Proposal] dual alias of the same module should result in a warning

2022-02-03 Thread José Valim
We can warn it for aliases no problems and a PR would be welcome. However, for imports it is a bit more complicated because you can import something multiple times with different parts. Furthermore, maybe a library Bar is doing "import Foo" and you want to repeat "import Foo" for clarity. I think

Re: [elixir-core:10751] Should this result in a warning?

2022-02-03 Thread José Valim
Hi Thibaut, There are two questions I asked myself: 1. What are the broadcast cases we can warn on to help people running into situations like these? 2. Can we emit false positives? One thing to keep in mind is that looking for "iex>" is already a bit lax today as it doesn't consider

[elixir-core:10751] [Proposal] dual alias of the same module should result in a warning

2022-02-03 Thread ku...@goyman.com
If a module is aliased or imported multipled times by the module, it would be handy to have a warning. For example: defmodule Foo do alias Ecto.Changeset alias Ecto.Changeset end should result in a warning "duplicate import". This is low priority, but as there is one for unused

[elixir-core:10750] Should this result in a warning?

2022-02-03 Thread thibaut...@gmail.com
Hello, While debugging some doctests I haven't written initially myself, I realised that one can create doctests that are bogus and will be skipped quite easily, just like this: ## Examples iex > SomeModule.some_method("param") "expected_output" The culprit is the extra space between "iex"

Re: [elixir-core:10748] Proposal: Allow `describe` blocks in ExUnit test to be skipped

2022-02-03 Thread 'eksperimental' via elixir-lang-core
It totally slipped my mind. I will update the docs to make this more noticeable, as of now if you look for "skip" the only relevant information is for skipping tests, not modules or describe blocks. Thank you Wojtek, On Thu, 03 Feb 2022 15:50:49 +0100 Wojtek Mach wrote: > This is already

Re: [elixir-core:10747] Proposal: Allow `describe` blocks in ExUnit test to be skipped

2022-02-03 Thread Wojtek Mach
This is already possible with `@describetag :skip` inside a describe block. There's a `@moduletag :skip` too! On February 3, 2022, elixir-lang-core wrote: > Currently `@tag :skip` is only effictive in tests, but if I have a > describe block with 10 test, i need to add the tag to each one >

[elixir-core:10746] Proposal: Allow `describe` blocks in ExUnit test to be skipped

2022-02-03 Thread 'eksperimental' via elixir-lang-core
Currently `@tag :skip` is only effictive in tests, but if I have a describe block with 10 test, i need to add the tag to each one individually. So I propose for the describe blocks to support the skip tag to ease development testing. -- You received this message because you are

Re: [elixir-core:10746] [Proposal] A 'concise' flag for 'mix test'

2022-02-03 Thread sp
Ah, that's much simpler! Thank you for the help! On Thursday, February 3, 2022 at 9:09:09 AM UTC-5 José Valim wrote: > IIRC "mix test --formatter MyFormatter" should do it. > > On Thu, Feb 3, 2022 at 3:06 PM sp wrote: > >> Hi José! Thank you for the reply! >> >> I thought about that, but

Re: [elixir-core:10744] [Proposal] A 'concise' flag for 'mix test'

2022-02-03 Thread José Valim
IIRC "mix test --formatter MyFormatter" should do it. On Thu, Feb 3, 2022 at 3:06 PM sp wrote: > Hi José! Thank you for the reply! > > I thought about that, but couldn't see a way to change the formatter based > on a custom flag for 'mix test'...? > > Ideally, I'd love to be able to run 'mix

Re: [elixir-core:10744] [Proposal] A 'concise' flag for 'mix test'

2022-02-03 Thread sp
Hi José! Thank you for the reply! I thought about that, but couldn't see a way to change the formatter based on a custom flag for 'mix test'...? Ideally, I'd love to be able to run 'mix test --concise' so I can change the formatter on the fly. On Thursday, February 3, 2022 at 8:59:18 AM UTC-5

Re: [elixir-core:10742] [Proposal] A 'concise' flag for 'mix test'

2022-02-03 Thread José Valim
Hi! ExUnit supports custom formatters, so my suggestion is to implement your own formatter and plug it in, without a need to change Elixir. :) On Thu, Feb 3, 2022 at 1:47 PM sp wrote: > Hello! > > While working through a project I found that I just wanted a print out of > tests that failed and

[elixir-core:10742] [Proposal] A 'concise' flag for 'mix test'

2022-02-03 Thread sp
Hello! While working through a project I found that I just wanted a print out of tests that failed and on what line instead of the full description and stack trace. Something like: test/my_test.exs:5 test/my_test.exs:12 etc I was able to 'grep' something close to this but feel it would be