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

Handle faulty doctest keyword arguments better #1557

Merged
merged 6 commits into from
Mar 23, 2021
Merged

Conversation

mortenpi
Copy link
Member

Does two things:

  1. If Meta.parse fails to parse the doctest keyword arguments (x-ref Doctest syntax error, how to find out where? #1556), it will gracefully report a doctest failure and move on (rather than making makedocs throw an unhelpful Meta.ParseError).
  2. If the keyword argument parsing fails, these now get logged as doctesting errors, and will fail the build with strict = true. Currently we just print a warning and move on.

Will close #1556. @fingolfin, do you mind trying out this branch for your case?

@mortenpi mortenpi added this to the 0.27.0 milestone Mar 18, 2021
@mortenpi mortenpi changed the title Handle faulty doctest keyword argument better Handle faulty doctest keyword arguments better Mar 18, 2021
@fingolfin
Copy link
Contributor

I can try it tomorrow. For the record, for some reason there was an isolated semicolon after jldoctest, i.e.:

```jldoctest;

@fingolfin
Copy link
Contributor

It works nicely!

...
┌ Warning: Unable to parse doctest keyword arguments in ~/Projekte/OSCAR/Oscar.jl/src/Groups/GAPGroups.jl:326-332
│ Use ```jldoctest name; key1 = value1, key2 = value2
│
│ ```jldoctest;
│ julia> cperm([1,2,3],4:7)
│ (1,2,3)(4,5,6,7)
│
│ julia> cperm([1,2],[2,3])
│ (1,3,2)
│ ```
│   parse_error = Base.Meta.ParseError("unexpected \",\"")
└ @ Documenter.DocTests ~/Projekte/Julia/packages/Documenter.jl/src/DocTests.jl:144
...

Great, thank you!

Support at-quietly on testsets better and fix a variable name that was
forgotten when IOCapture was bumped.
@mortenpi
Copy link
Member Author

Thanks for testing! Added it as a test case.

@mortenpi mortenpi merged commit b2bab81 into master Mar 23, 2021
@mortenpi mortenpi deleted the mp/doctest-kwargs branch March 23, 2021 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Doctest syntax error, how to find out where?
2 participants