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

Revert "Pin JuliaFormatter to v2 and fix new formatting failures" #201

Merged
merged 1 commit into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .ci/Project.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
[deps]
JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899"

[compat]
JuliaFormatter = "2"
8 changes: 4 additions & 4 deletions src/QuartoNotebookWorker/src/render.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
return ((;
code = "", # an expanded cell that errored can't have returned code
cell_options = Dict{String,Any}(), # or options
results = Dict{String,@NamedTuple{error::Bool,data::Vector{UInt8}}}(),
results = Dict{String,@NamedTuple{error::Bool, data::Vector{UInt8}}}(),

Check warning on line 60 in src/QuartoNotebookWorker/src/render.jl

View check run for this annotation

Codecov / codecov/patch

src/QuartoNotebookWorker/src/render.jl#L60

Added line #L60 was not covered by tests
display_results,
output = captured.output,
error = string(typeof(error)),
Expand Down Expand Up @@ -294,7 +294,7 @@

if mimetype
non_worker = findfirst(x -> contains(String(x.file), @__FILE__), bt)
bt = bt[1:max(something(non_worker, length(bt))-3, 0)]
bt = bt[1:max(something(non_worker, length(bt)) - 3, 0)]

Check warning on line 297 in src/QuartoNotebookWorker/src/render.jl

View check run for this annotation

Codecov / codecov/patch

src/QuartoNotebookWorker/src/render.jl#L297

Added line #L297 was not covered by tests
end

buf = IOBuffer()
Expand Down Expand Up @@ -329,7 +329,7 @@
options = NotebookState.OPTIONS[]
to_format = rget(options, ("format", "pandoc", "to"), nothing)

result = Dict{String,@NamedTuple{error::Bool,data::Vector{UInt8}}}()
result = Dict{String,@NamedTuple{error::Bool, data::Vector{UInt8}}}()

Check warning on line 332 in src/QuartoNotebookWorker/src/render.jl

View check run for this annotation

Codecov / codecov/patch

src/QuartoNotebookWorker/src/render.jl#L332

Added line #L332 was not covered by tests
# Some output formats that we want to write to need different
# handling of valid MIME types. Currently `docx` and `typst`. When
# we detect that the `to` format is one of these then we select a
Expand Down Expand Up @@ -417,7 +417,7 @@
return result
end
render_mimetypes(value::Nothing, cell_options; inline::Bool = false) =
Dict{String,@NamedTuple{error::Bool,data::Vector{UInt8}}}()
Dict{String,@NamedTuple{error::Bool, data::Vector{UInt8}}}()

Check warning on line 420 in src/QuartoNotebookWorker/src/render.jl

View check run for this annotation

Codecov / codecov/patch

src/QuartoNotebookWorker/src/render.jl#L420

Added line #L420 was not covered by tests


# Our custom MIME types need special handling. They get rendered to
Expand Down
2 changes: 1 addition & 1 deletion src/precompile.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PrecompileTools.@setup_workload begin
notebook = joinpath(@__DIR__, "..", "test", "examples", "cell_types.qmd")
script = joinpath(@__DIR__, "..", "test", "examples", "cell_types.jl")
results = Dict{String,@NamedTuple{error::Bool,data::Vector{UInt8}}}()
results = Dict{String,@NamedTuple{error::Bool, data::Vector{UInt8}}}()
PrecompileTools.@compile_workload begin
raw_text_chunks(notebook)
raw_text_chunks(script)
Expand Down
2 changes: 1 addition & 1 deletion src/server.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,7 @@ values. We do here rather than in the worker because we don't want to have to
define additional functions in the worker and import `Base64` there. The worker
just has to provide bytes.
"""
function process_results(dict::Dict{String,@NamedTuple{error::Bool,data::Vector{UInt8}}})
function process_results(dict::Dict{String,@NamedTuple{error::Bool, data::Vector{UInt8}}})
funcs = Dict(
"application/json" => json_reader,
"application/pdf" => Base64.base64encode,
Expand Down
Loading