After sleeping on it, I realise that I've come across this specific problem
only once, ever, since working with Elixir.

Also it reminds me of another case where the doctests were written, but not
registered in the test case, causing similar consequences (if I recall
well).

Maybe there is a broader theme of "how to make sure doctests cannot catch
people off guard", but for the specific problem I've raised here, I
believe some time is probably needed to see clearer, because the drawbacks
of "managing" this (false positives / how to whitelist them etc) are very
real too.

I'll comment back if I meet those issues in a later codebase :-)

-- Thibaut







Le ven. 4 févr. 2022 à 09:21, José Valim <jose.va...@dashbit.co> a écrit :

> As a general principle the formatter does not change the AST and changing
> the contents of a string would definitely change the AST. :)
>
> On Fri, Feb 4, 2022 at 9:10 AM Adam Lancaster <a...@a-corp.co.uk> wrote:
>
>> Is it something the formatter could handle at all? Perhaps with a best
>> effort if it ever sees `iex >` it makes it `iex>`
>>
>> Best
>>
>> Adam
>>
>> On 4 Feb 2022, at 07:23, Valter Sundström <valter.sundst...@gmail.com>
>> wrote:
>>
>> 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.
>> Accidentally dropping tests silently seems a lot worse, even if I think
>> that the situation shouldn't happen often if tests are properly run when
>> being made (e.g watching them fail at least once, specifically to make sure
>> your test is actually doing what you think).
>> In the worst case, it also seems a change like this could be reverted in
>> a following minor release if it really turns out to give too many false
>> positives.
>>
>> Just my casual input
>> // Valter
>>
>> --
>> 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 elixir-lang-core+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/elixir-lang-core/CAPkwuK%3DbGV7yWuvW5Xo_gThGo3_XKbcZX0Tzeh-%2BphHJh5iMxg%40mail.gmail.com
>> <https://groups.google.com/d/msgid/elixir-lang-core/CAPkwuK%3DbGV7yWuvW5Xo_gThGo3_XKbcZX0Tzeh-%2BphHJh5iMxg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>>
>> --
>> 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 elixir-lang-core+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/elixir-lang-core/5028A1A0-7302-4586-A7CD-F03EC26089E3%40a-corp.co.uk
>> <https://groups.google.com/d/msgid/elixir-lang-core/5028A1A0-7302-4586-A7CD-F03EC26089E3%40a-corp.co.uk?utm_medium=email&utm_source=footer>
>> .
>>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "elixir-lang-core" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/elixir-lang-core/kqal5g87_EE/unsubscribe
> .
> To unsubscribe from this group and all its topics, send an email to
> elixir-lang-core+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4KAb5hHvvmuwrdFaUhbeFdauEghrOg0Tqmd1Vj4-V%3DofQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4KAb5hHvvmuwrdFaUhbeFdauEghrOg0Tqmd1Vj4-V%3DofQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 elixir-lang-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/CABoqfJeP8JMWB0DC%2BdZ6_YO33Gk2%3DxRPbu0V6ya0RF9JbBS_JA%40mail.gmail.com.

Reply via email to