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

purge doctest stacktraces #23988

Merged
merged 3 commits into from
Oct 6, 2017
Merged

purge doctest stacktraces #23988

merged 3 commits into from
Oct 6, 2017

Conversation

KristofferC
Copy link
Sponsor Member

@KristofferC KristofferC commented Oct 4, 2017

See discussion in #22075
cc @rfourquet

@rfourquet
Copy link
Member

LGTM. What about leaving the Stacktrace: line to make explicit that only the stacktrace is omitted?

@KristofferC
Copy link
Sponsor Member Author

I had that first but then I removed it when I saw you had removed it hehe.

@KristofferC
Copy link
Sponsor Member Author

I will add the stacktrace header back.

of julia code) when the doctest shows that an exception is thrown,
for example:

````julia
Copy link
Contributor

Choose a reason for hiding this comment

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

is this valid markdown?

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

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

Worked locally.

Copy link
Sponsor Member

@StefanKarpinski StefanKarpinski left a comment

Choose a reason for hiding this comment

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

❤️

@ViralBShah
Copy link
Member

I'm late to this party, but it does appear that the stacktraces are useful.

[...]
```
````

Examples that are untestable should be written within fenced code blocks starting with ````` ```julia`````
Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, got it. So this is wrong, for example.

@KristofferC
Copy link
Sponsor Member Author

What does "it does appear" mean?

Also the stacktraces are kept when they either are relevant to the documentation or when the functions they contain are defined in the neighborhood.

It is hard for me to see the argument that showing six lines of internal functions in an example is a user friendly documentation.

@StefanKarpinski
Copy link
Sponsor Member

Yeah, I don't really get the pushback against this. 99% of the time no one cares about the stack traces so the default should be not including them. In the 1% cases where it's useful, we can still include it.

@tkelman
Copy link
Contributor

tkelman commented Oct 4, 2017

Only one of these is showing 6 frames deep. The top handful of frames, up to the function that actually gets called, is useful to some people - it tells you where the definition is (especially when nicely linked like in IJulia) that's throwing the error in question. In a perfect world code examples in the docs would be shown as live notebook-style runnable snippets with [most of] the actual output. You might want to collapse long backtraces by default and have them easily expandable with a single click, but static markdown docs don't allow that level of interactivity.

@ViralBShah
Copy link
Member

It appears as in as I looked at it, I felt that things looked better with stacktraces. But, I do not wish to have this PR be blocked because of my slight preference to see the stacktrace. I can imagine that having a 15 line stacktrace is not the best thing in 99% of the cases, but there are certainly cases where the stacktraces are useful to show in the documentation when the error happens.

Maybe, the thing to do is merge this, and introduce them in the 1% cases where they clearly may help.

@StefanKarpinski
Copy link
Sponsor Member

Since this is one of the main things preventing us from turning doc tests on, we should go ahead with this and if anyone feels that we really need the stack traces in some places, the onus is on them to implement the necessary Documenter.jl feature and insert the desired stack traces.

@kshyatt kshyatt added the docsystem The documentation building system label Oct 5, 2017
@KristofferC KristofferC merged commit b76c24e into master Oct 6, 2017
@KristofferC KristofferC deleted the kc/purge_doctest_stacktraces branch October 6, 2017 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docsystem The documentation building system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants