-
Notifications
You must be signed in to change notification settings - Fork 486
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
Log @error
for any DocCheck which triggers a failure.
#1349
Conversation
Ah! These should actually depend on whether |
Is that worth it? |
I think so. It's gonna obscure real errors when you're running |
It's just as confusing at the moment: trying to figure out why I would argue |
The rule of thumb I would go for is that it's red if and only if it's gonna crash the build. If you're running I completely agree that Documenter's errors/warnings are not the most user-friendly. However, I am not sure a stacktrace deep into to Documenter's internals is going to help the user that much either. A better solution is to improve the error messages. Regarding whether to error one by one or all at once: when you're working on docs, you often end up with many errors. So I think it's actually better user experience to show all the errors at once, rather than having the user re-build the docs over and over again, as they're tracking down all the issues. What I imagine is that you see a ton of red in the terminal, you go through them one by one, fix the issues, and then when you re-run the build, it should pass. |
I disagree: if I can see where the error is triggered, I can find out what I need to fix it. Currently all I get is a bunch of "Warnings" with no indication which one is the problem. |
Sorry, I missed your reply here.
I genuinely do not see how knowing that there is an That said, if you believe it would be useful, we could have it as an option that you could enable (e.g. by passing However, either way, when Documenter should throw an error is orthogonal to how the error messages should be styled.
A thing should be a problem (i.e. cause Documenter to throw an error) if and only if it is an error. It is true that currently Documenter is not entirely consistent on that front (#1088), but dynamically picking the error level with |
This makes it easier to distinguish other warnings (e.g. redirects) from those which actually trigger a DocCheck failure.
f2d82d2
to
903312a
Compare
Okay, I've updated the PR to vary the log level as you suggest in #1088. If you're happy with this approach, I can use it elsewhere. It could be slightly simplified by using a macro, e.g. macro logstrict(doc, label, args...)
quote
push!($(esc(doc)).internal.errors, $(esc(label)))
@logmsg $(esc(doc)).user.strict ? Logging.Warn : Logging.Error $(args...)
end
end |
bump? |
Sorry for the delay. This looks great! I think the macro approach would make it much cleaner, so if you don't mind updating the PR, it would be great to have. But we can also go with the current implementation. |
I'll go ahead and merge this for inclusion in 0.25.1. We can always change to a macro later. |
This makes it easier to distinguish other warnings (e.g. redirects) from those which actually trigger a DocCheck failure.
Fixes #1088.
Edit by @mortenpi: changed the issue number that this will close.