Skip to content

Conversation

eksperimental
Copy link
Contributor

Update warning messages based on Ref's visibility Messages are more accurate now. Deal with private types 

This PR spawned from #1205 tackling most of the issues addressed there.

@eksperimental
Copy link
Contributor Author

Please do not squash the commits

@eksperimental eksperimental force-pushed the warning_based_on_refs branch from be67210 to 143c75b Compare July 23, 2020 06:39
@wojtekmach
Copy link
Member

I tested this branch against Elixir docs and got these warnings:

warning: documentation references type "Exception.optional/1" but it is undefined lib/elixir/lib/exception.ex:15: t:Exception.t/0 warning: documentation references type "URI.optional/1" but it is undefined lib/elixir/lib/uri.ex:115: URI.decode_query/2 warning: documentation references type "URI.optional/1" but it is undefined lib/elixir/lib/uri.ex:115: URI.decode_query/2 (...) 
@eksperimental
Copy link
Contributor Author

eksperimental commented Jul 25, 2020

I tested this branch against Elixir docs and got these warnings:

warning: documentation references type "Exception.optional/1" but it is undefined lib/elixir/lib/exception.ex:15: t:Exception.t/0 warning: documentation references type "URI.optional/1" but it is undefined lib/elixir/lib/uri.ex:115: URI.decode_query/2 warning: documentation references type "URI.optional/1" but it is undefined lib/elixir/lib/uri.ex:115: URI.decode_query/2 (...) 

It is the last missing piece to be implemented
#1219

@eksperimental eksperimental force-pushed the warning_based_on_refs branch from b577cda to f533827 Compare July 26, 2020 01:42
@eksperimental eksperimental requested a review from wojtekmach July 26, 2020 02:01
@eksperimental eksperimental force-pushed the warning_based_on_refs branch 3 times, most recently from f8e5e3b to c7a8e03 Compare August 4, 2020 23:31
@eksperimental
Copy link
Contributor Author

Rebased to master.
This is ready for review @wojtekmach
Please do not squash the commits.

assert warn(~m"[an unknown task](`mix unknown.task`)") =~
"documentation references \"mix unknown.task\" but it is undefined"

assert_unchanged(~m"[an unknown task](`mix unknown.task`)")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a lot of these new assertions were already present in the warnings tests, could you remove the duplicates and move remaining ones to the warnings test?

Copy link
Contributor Author

@eksperimental eksperimental Sep 15, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have moved all the warnings to its own test, regarding the non warning ones. the Elixir ones are only checked in the test named "special case links" and the Erlang ones are not checked anywhere. I would say it is better to leave them in this test

@@ -1,5 +1,5 @@
defmodule ExDoc.AutolinkTest do
use ExUnit.Case, async: true
use ExUnit.Case
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we test all warnings in that one test we could run it concurrently again, should we do that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests do not run concurrently within the same module, regardless of the :async option, so that wouldn't be the limitation, if that is what you mean.
Concurrency was disabled because there are two ExUnit cases that are capturing :stderr, the other one is ExDoc.CLITest

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is supported on Elixir v1.11 though so let's leave the option in and push everyone to more recent Elixir versions.

Copy link
Contributor Author

@eksperimental eksperimental Sep 15, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is supported on Elixir v1.11 though so let's leave the option in and push everyone to more recent Elixir versions.

@josevalim Sorry, but what is supported in v1.11?

Copy link
Contributor Author

@eksperimental eksperimental Sep 15, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we test all warnings in that one test we could run it concurrently again, should we do that?

Do we really have a limitation having different tests emitting a warning since they are in the same test case , since they do not run concurrently within the same test case?

@eksperimental eksperimental force-pushed the warning_based_on_refs branch 3 times, most recently from 6d3f749 to 16669a1 Compare September 15, 2020 16:59
@josevalim
Copy link
Member

josevalim commented Sep 15, 2020 via email

@eksperimental
Copy link
Contributor Author

Concurrent captures of stderr. -- José Valimhttps://dashbit.co/ https://dashbit.co/

Oh.. I was not aware of. Is this documented somewhere? I couldn't find any reference nor in the ExUnit.CaptureIO docs neither in the CHANGELOG

@josevalim
Copy link
Member

josevalim commented Sep 15, 2020 via email

@eksperimental
Copy link
Contributor Author

Maybe it is in 1.10 then? -- José Valimhttps://dashbit.co/ https://dashbit.co/

is this the PR? elixir-lang/elixir#9527

@josevalim
Copy link
Member

Yes!

@eksperimental
Copy link
Contributor Author

Sorry, I accidentally closed this, and I am unable to reopen it. Can anybody reopen it?

@josevalim
Copy link
Member

Apparently I cannot reopen it either.

@eksperimental
Copy link
Contributor Author

eksperimental commented Sep 15, 2020

I accidentally force pushed to a version that was a the same commit as master, and GitHub automatically closed it.

@eksperimental eksperimental reopened this Sep 15, 2020
Copy link
Member

@wojtekmach wojtekmach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thank you. I added a few comments. Please also rebase with latest master.

@eksperimental
Copy link
Contributor Author

Looks good to me, thank you. I added a few comments. Please also rebase with latest master.

All suggestions implemented. And code has been rebased to master.

@eksperimental eksperimental force-pushed the warning_based_on_refs branch from a34b496 to 3d75cc0 Compare October 5, 2020 15:52
@wojtekmach wojtekmach merged commit 4e647e6 into elixir-lang:master Oct 6, 2020
@wojtekmach
Copy link
Member

Thanks!

@eksperimental
Copy link
Contributor Author

Thank you @wojtekmach for reviewing this one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants