Skip to content
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
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Aqua = "0.8"
JET = "0.9, 0.10, 0.11"
LinearAlgebra = "1.10"
SafeTestsets = "0.1"
SciMLTesting = "1.6"
SciMLTesting = "2.1"
Statistics = "1.10"
Test = "1.10"
julia = "1.10"
Expand Down
5 changes: 1 addition & 4 deletions test/qa/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,12 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
SurrogatesBase = "89f642e6-4179-4274-8202-c11f4bd9a72c"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[sources]
SurrogatesBase = {path = "../.."}

[compat]
Aqua = "0.8"
JET = "0.9, 0.10, 0.11"
LinearAlgebra = "1.10"
SafeTestsets = "0.1"
SciMLTesting = "1.6"
SciMLTesting = "2.1"
Statistics = "1.10"
Test = "1.10"
julia = "1.10"
41 changes: 1 addition & 40 deletions test/qa/qa.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,46 +5,7 @@ using LinearAlgebra
using Test
import Statistics

run_qa(SurrogatesBase; explicit_imports = true)

function documented_api_names()
api_path = joinpath(@__DIR__, "..", "..", "docs", "src", "api.md")
prefix = string(nameof(SurrogatesBase), ".")
documented_names = Symbol[]

for line in eachline(api_path)
stripped = strip(line)
startswith(stripped, prefix) || continue
push!(documented_names, Symbol(stripped[(lastindex(prefix) + 1):end]))
end

return sort!(unique(documented_names))
end

function has_source_docstring(mod::Module, name::Symbol)
doc = Docs.doc(getfield(mod, name))
doc === nothing && return false

return !occursin("No documentation found", sprint(show, MIME("text/plain"), doc))
end

@testset "public API documentation coverage" begin
public_names = sort!(
setdiff(
names(SurrogatesBase; all = false, imported = false),
[nameof(SurrogatesBase)]
)
)

missing_docstrings = [
name for name in public_names
if !has_source_docstring(SurrogatesBase, name)
]
missing_docs_entries = setdiff(public_names, documented_api_names())

@test missing_docstrings == Symbol[]
@test missing_docs_entries == Symbol[]
end
run_qa(SurrogatesBase; explicit_imports = true, api_docs_kwargs = (; rendered = true))

# JET.report_call type-stability analysis of concrete user-defined surrogates.
# This goes beyond run_qa's package-level JET.test_package: it checks that the
Expand Down
Loading