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

More jldoctest issues with format_docstrings #812

Open
mweerden opened this issue Feb 15, 2024 · 0 comments
Open

More jldoctest issues with format_docstrings #812

mweerden opened this issue Feb 15, 2024 · 0 comments

Comments

@mweerden
Copy link

When format_docstrings is set to true, I see the following issues:

Empty jldoctest:

"""
```jldoctest
```
"""
f() = 1

Gives:

┌ Warning: Error occurred during prettification
│   line = 4
│   offset = 4
└ @ JuliaFormatter ~/.julia/packages/JuliaFormatter/FPeem/src/JuliaFormatter.jl:252
ERROR: BoundsError: attempt to access 0-element Vector{CSTParser.EXPR} at index [1]

Triple quotes inside jldoctest:

"""
```jldoctest
\"""
```
"""
f() = 1

Gives:

┌ Warning: Error occurred during prettification
│   line = 5
│   offset = 4
└ @ JuliaFormatter ~/.julia/packages/JuliaFormatter/FPeem/src/JuliaFormatter.jl:252
ERROR: Parsing error for input occurred on line 1, offset: 1

Filter with backslashes:

"""
```jldoctest; filter = r"\\x1b\\[[^m]*m"
julia> 1;
```
"""
f() = 1

Is broken after formatting because backslashes are "evaluated":

"""
```jldoctest; filter = r"\x1b\[[^m]*m"
julia> 1;

```
"""
f() = 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant