Skip to content

Commit

Permalink
test: check that all public names have docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
gdalle committed Nov 24, 2024
1 parent 6b55559 commit 82e8d0c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
3 changes: 2 additions & 1 deletion DifferentiationInterface/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
ComponentArrays = "b0b7db55-cfe3-40fc-9ded-d10e2dbeff66"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Diffractor = "9f5e2b26-1114-432f-b630-d3fe2085c51c"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9"
ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7"
FastDifferentiation = "eb9bf01b-bf85-4b60-bf87-ee5de06c00be"
Expand All @@ -99,4 +100,4 @@ Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"

[targets]
test = ["ADTypes", "Aqua", "ComponentArrays", "DataFrames", "ExplicitImports", "ForwardDiff", "JET", "JLArrays", "JuliaFormatter", "Pkg", "Random", "SparseArrays", "SparseConnectivityTracer", "SparseMatrixColorings", "StableRNGs", "StaticArrays", "Test", "Zygote"]
test = ["ADTypes", "Aqua", "ComponentArrays", "DataFrames", "Documenter", "ExplicitImports", "ForwardDiff", "JET", "JLArrays", "JuliaFormatter", "Pkg", "Random", "SparseArrays", "SparseConnectivityTracer", "SparseMatrixColorings", "StableRNGs", "StaticArrays", "Test", "Zygote"]
8 changes: 8 additions & 0 deletions DifferentiationInterface/test/Misc/Internals/_formalities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

using Aqua: Aqua
using DifferentiationInterface
using Documenter: Documenter
using ExplicitImports
using JET: JET
using JuliaFormatter: JuliaFormatter
Expand All @@ -23,6 +24,13 @@ end
@test JuliaFormatter.format(DifferentiationInterface; verbose=false, overwrite=false)
end

@testset "Documentation" begin
Documenter.doctest(DifferentiationInterface)
if VERSION >= v"1.11"
@test isempty(Docs.undocumented_names(DifferentiationInterface))
end
end

@testset "ExplicitImports" begin
@test check_no_implicit_imports(DifferentiationInterface) === nothing
@test check_no_stale_explicit_imports(DifferentiationInterface) === nothing
Expand Down
3 changes: 2 additions & 1 deletion DifferentiationInterfaceTest/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
ComponentArrays = "b0b7db55-cfe3-40fc-9ded-d10e2dbeff66"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
DifferentiationInterface = "a0c0ee7d-e4b9-4e03-894e-1c5f64a51d63"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7"
FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41"
FiniteDifferences = "26cc04aa-876d-5657-8c51-4c34ba976000"
Expand All @@ -91,4 +92,4 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"

[targets]
test = ["ADTypes", "Aqua", "ComponentArrays", "DataFrames", "DifferentiationInterface", "ExplicitImports", "FiniteDifferences", "Flux", "ForwardDiff", "JET", "JLArrays", "JuliaFormatter", "Pkg", "Random", "SparseArrays", "SparseConnectivityTracer", "SparseMatrixColorings", "StaticArrays", "Test", "Zygote"]
test = ["ADTypes", "Aqua", "ComponentArrays", "DataFrames", "DifferentiationInterface", "Documenter", "ExplicitImports", "FiniteDifferences", "Flux", "ForwardDiff", "JET", "JLArrays", "JuliaFormatter", "Pkg", "Random", "SparseArrays", "SparseConnectivityTracer", "SparseMatrixColorings", "StaticArrays", "Test", "Zygote"]
8 changes: 8 additions & 0 deletions DifferentiationInterfaceTest/test/formalities.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using DifferentiationInterface
using DifferentiationInterfaceTest
using Aqua: Aqua
using Documenter: Documenter
using ExplicitImports
using JET: JET
using JuliaFormatter: JuliaFormatter
Expand All @@ -21,6 +22,13 @@ end
JET.test_package(DifferentiationInterfaceTest; target_defined_modules=true)
end

@testset "Documentation" begin
Documenter.doctest(DifferentiationInterfaceTest)
if VERSION >= v"1.11"
@test isempty(Docs.undocumented_names(DifferentiationInterfaceTest))
end
end

@testset "ExplicitImports" begin
@test_broken check_no_implicit_imports(DifferentiationInterfaceTest) === nothing
@test_broken check_no_stale_explicit_imports(DifferentiationInterfaceTest) === nothing
Expand Down

0 comments on commit 82e8d0c

Please sign in to comment.