-
Notifications
You must be signed in to change notification settings - Fork 481
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
If strict=true
and a @repl
block throws an exception, the build should fail
#1447
base: master
Are you sure you want to change the base?
If strict=true
and a @repl
block throws an exception, the build should fail
#1447
Conversation
@mortenpi This PR takes care of the global behavior. We still need the ability to opt-out on a per-block basis via the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be good to do allowexceptions
together with this change, so it would be easy for people who are relying on errors in at-repl to upgrade.
Re implementation: I think our current state of the art for keyword handling is this:
Documenter.jl/src/Expanders.jl
Lines 539 to 540 in 9801cf4
# "parse" keyword arguments to example (we only need to look for continued = true) | |
continued = occursin(r"continued\s*=\s*true", x.language) |
I've always felt that we should have a function that takes the at-block lang. string and returns something that contains all the positional and keyword arguments. Maybe even relying on Meta.parse
for the parsing? That said, a simple regex could also do. I think that's all we'd need?
src/Expanders.jl
Outdated
@info(""" | ||
encountered an exception while running a `@repl` block | ||
that allows exceptions | ||
""", exception=(c.value, c.backtrace)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're explicitly allowing exceptions, I don't think we want to write anything to the terminal? Could always turn it into an @debug
though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah @debug
sounds good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to @debug
Actually, the state of the art is in doctests, so we should probably generalize that: Lines 124 to 156 in 9801cf4
|
Just to check in with this: it just needs argument handling for the relevant at-blocks to locally set |
Yep. I'll take a stab at implementing the keyword handling. |
0890821
to
9973808
Compare
a892477
to
9760870
Compare
6c1ad26
to
6cb15db
Compare
It's been a while since I looked at this. @mortenpi Can you remind me where I should look to figure out how to handle the keyword arguments? |
Before this PR:
strict
true
@example
true
@repl
false
@example
false
@repl
After this PR:
strict
true
@example
true
@repl
false
@example
false
@repl
This is a breaking change.