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

Use jldoctest wherever possible #56921

Open
LilithHafner opened this issue Dec 30, 2024 · 12 comments
Open

Use jldoctest wherever possible #56921

LilithHafner opened this issue Dec 30, 2024 · 12 comments
Labels
docs This change adds or pertains to documentation good first issue Indicates a good issue for first-time contributors to Julia help wanted Indicates that a maintainer wants help on an issue or pull request

Comments

@LilithHafner
Copy link
Member

LilithHafner commented Dec 30, 2024

jldoctest didn't used to support repl mode so we have a bunch of code blocks with julia-repl tags that should really be jldoctest instead.

Or, if you're feeling ambitious, it would be nice to audit all code blocks (grep for ```) and make as many as possible jldoctest.

Advice for folks implementing this

@LilithHafner LilithHafner added docs This change adds or pertains to documentation help wanted Indicates that a maintainer wants help on an issue or pull request labels Dec 30, 2024
@inkydragon inkydragon added the good first issue Indicates a good issue for first-time contributors to Julia label Dec 31, 2024
@xyz-harshal
Copy link

xyz-harshal commented Jan 4, 2025

can i work on this issue?

@inkydragon
Copy link
Member

can i work on this issue?

Of course, you can always contribute when the issue remains open.
Just open a PR.

I would recommend that a pr contain a small number of changes so that it's easy to review.

@Kunal-sharma24
Copy link

Kunal-sharma24 commented Jan 19, 2025

jldoctest didn't used to support repl mode so we have a bunch of code blocks with julia-repl tags that should really be jldoctest instead.

Or, if you're feeling ambitious, it would be nice to audit all code blocks (grep for ```) and make as many as possible jldoctest.

hey i just want to ask that to replace all the julia-repl to jldoctest did i have to replace it manually because the whole code contains minimum 750 changes

@inkydragon
Copy link
Member

did i have to replace it manually

You don't need to replace them manually, but there may be many cases where you need to update the REPL output.
Or maybe some of the examples are platform-specific and have different return values on different platforms, so they shouldn't be labeled as julia-repl.

I recommend running doctest after the automatic replacement to check that the output matches.
Of course, you can also open a draft PR and let the CI check it for you and then fix the error.

Another suggestion is to have a PR that contains only a few changes to make it easier to review.

@LilithHafner
Copy link
Member Author

PR: #57100

@JRS296
Copy link

JRS296 commented Feb 18, 2025

@inkydragon I was browsing through the Julia project and came across this issue. Has it been resolved? And if not, could I take a look at trying to reolve it?

@LilithHafner
Copy link
Member Author

The issue is still open and you can always contribute, just open a PR.

@vivekTiw120303
Copy link

Hello Sir, I have been working on this issue, and submitted a PR regarding the changes in collection,md file in doc/src/base, but i don't know why the buildkite/julia-master is failing for 5-6 times. Can u please guide me for this issue. I genuinely wanted to work on this issue.

@LilithHafner
Copy link
Member Author

We can talk about that on the PR you opened :)

@persinammon4
Copy link

persinammon4 commented Mar 20, 2025

Hi, I wrote this PR for this task: #57840

It doesn't get all of the julia-repl's, just the ones in logging.jl and basedocs.jl.

In general, make -C doc doctest=true doesn't work on my computer, so I was hoping for a reviewer to quickly run that command on their computer. make doc does, though and the other steps work.

Edit: I have a similar issue as previous poster, multiple checks fail including buildkite/julia-master. Not sure why that'd be.

@persinammon4
Copy link

persinammon4 commented Mar 20, 2025

I don't think it's a good idea to change this, although I am new. The doctests are failing because the answers are randomized and so aren't exactly the same as the written answer of what it should be, even though the written answer is also randomized.

@LilithHafner
Copy link
Member Author

Please use the thread associated with that PR to discuss it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This change adds or pertains to documentation good first issue Indicates a good issue for first-time contributors to Julia help wanted Indicates that a maintainer wants help on an issue or pull request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants