Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor warning generation #1762

Closed
viniciusmuller opened this issue Sep 7, 2023 · 4 comments
Closed

Refactor warning generation #1762

viniciusmuller opened this issue Sep 7, 2023 · 4 comments

Comments

@viniciusmuller
Copy link
Contributor

I've noticed we have quite a few ways of warning and the most standardized one we have is on the Autolink module.

Perhaps for some general cases we could move this to a new helper module?

There are certain cases with a different format (no ANSI yellow on warning, no stacktrace like this):
https://github.com/elixir-lang/ex_doc/blob/6645809b2c4434221a2005b22646ad55ea2db069/lib/ex_doc/formatter/html.ex#L267C11-L267C11

I think moving this base warning logic for different cases into a specific module would help with code clarity and also make the warnings more consistent (as currently updating the mentioned piece of code to call Autolink just because of its warning function feels weird to me)

@wojtekmach
Copy link
Member

Let's wait for #1564 and revisit!

@josevalim josevalim changed the title Proposal: Refactor warning generation Refactor warning generation Sep 14, 2023
@viniciusmuller
Copy link
Contributor Author

We might also want to use IO.warn more and pass the file + line information to it, since it will create a diagnostic which will be more nicely printed by the upcoming elixir release

@josevalim
Copy link
Member

👍 with moving to IO.warn!

@wojtekmach
Copy link
Member

I've moved to IO.warn for autolinks in #1805 (comment). We can keep this issue open until we move remaining warnings we emit.

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

No branches or pull requests

3 participants