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

doctest_fix: try setting fixed default terminal size #4171

Merged
merged 2 commits into from
Oct 2, 2024
Merged
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
46 changes: 26 additions & 20 deletions src/utils/docs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,15 @@
S = Symbol(f)
doc, doctest = get_document(set_meta)

with_unicode(false) do
#essentially inspired by Documenter/src/DocTests.jl
pm = parentmodule(f)
bm = Base.Docs.meta(pm)
md = bm[Base.Docs.Binding(pm, S)]
for s in md.order
doctest(md.docs[s], Oscar, doc)
withenv("COLUMNS"=>80, "LINES"=>24) do
with_unicode(false) do

Check warning on line 74 in src/utils/docs.jl

View check run for this annotation

Codecov / codecov/patch

src/utils/docs.jl#L73-L74

Added lines #L73 - L74 were not covered by tests
#essentially inspired by Documenter/src/DocTests.jl
pm = parentmodule(f)
bm = Base.Docs.meta(pm)
md = bm[Base.Docs.Binding(pm, S)]
for s in md.order
doctest(md.docs[s], Oscar, doc)
end

Check warning on line 81 in src/utils/docs.jl

View check run for this annotation

Codecov / codecov/patch

src/utils/docs.jl#L76-L81

Added lines #L76 - L81 were not covered by tests
end
end
end
Expand All @@ -97,14 +99,16 @@
function doctest_fix(path::String; set_meta::Bool=false)
doc, doctest = get_document(set_meta)

with_unicode(false) do
walkmodules(Oscar) do m
#essentially inspired by Documenter/src/DocTests.jl
bm = Base.Docs.meta(m)
for (_, md) in bm
for s in md.order
if occursin(path, md.docs[s].data[:path])
doctest(md.docs[s], Oscar, doc)
withenv("COLUMNS"=>80, "LINES"=>24) do
with_unicode(false) do
walkmodules(Oscar) do m

Check warning on line 104 in src/utils/docs.jl

View check run for this annotation

Codecov / codecov/patch

src/utils/docs.jl#L102-L104

Added lines #L102 - L104 were not covered by tests
#essentially inspired by Documenter/src/DocTests.jl
bm = Base.Docs.meta(m)
for (_, md) in bm
for s in md.order
if occursin(path, md.docs[s].data[:path])
doctest(md.docs[s], Oscar, doc)

Check warning on line 110 in src/utils/docs.jl

View check run for this annotation

Codecov / codecov/patch

src/utils/docs.jl#L106-L110

Added lines #L106 - L110 were not covered by tests
end
end
end
end
Expand Down Expand Up @@ -218,11 +222,13 @@
if !isdefined(Main, :BuildDoc)
doc_init()
end
with_unicode(false) do
Pkg.activate(docsproject) do
Base.invokelatest(
Main.BuildDoc.doit, Oscar; warnonly=warnonly, local_build=true, doctest=doctest
)
withenv("COLUMNS"=>80, "LINES"=>24) do
with_unicode(false) do
Pkg.activate(docsproject) do
Base.invokelatest(

Check warning on line 228 in src/utils/docs.jl

View check run for this annotation

Codecov / codecov/patch

src/utils/docs.jl#L225-L228

Added lines #L225 - L228 were not covered by tests
Main.BuildDoc.doit, Oscar; warnonly=warnonly, local_build=true, doctest=doctest
)
end
end
end
if start_server
Expand Down
Loading