Skip to content

Commit

Permalink
Add doctest, run doctest in runtest.jl
Browse files Browse the repository at this point in the history
Doctests should now be included in CI run and `Pkg.test`, which makes more sense than running doctests when building the documentation. Also add new doctest for `interpolate_mini` and update some formatting.
  • Loading branch information
cgarling committed Jun 9, 2024
1 parent bb3e7c4 commit a93aecf
Show file tree
Hide file tree
Showing 5 changed files with 187 additions and 179 deletions.
4 changes: 3 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"

[compat]
Distributions = "0.25"
Documenter = "1"
DynamicHMC = "3.4.2" # Changed stack_posterior_matrices order https://github.com/tpapp/DynamicHMC.jl/pull/175
InitialMassFunctions = "0.1"
Interpolations = "0.13.4, 0.14, 0.15"
Expand All @@ -48,6 +49,7 @@ julia = "1.7"

[extras]
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DynamicHMC = "bbc10e6e-7c05-544b-b16e-64fede858acb"
InitialMassFunctions = "e9251ff4-c148-4db3-bf46-89407750fae0"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand All @@ -60,4 +62,4 @@ StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Distributions", "DynamicHMC", "InitialMassFunctions", "LinearAlgebra", "MCMCChains", "QuadGK", "Random", "SafeTestsets", "StableRNGs", "StaticArrays", "Test"]
test = ["Distributions", "Documenter", "DynamicHMC", "InitialMassFunctions", "LinearAlgebra", "MCMCChains", "QuadGK", "Random", "SafeTestsets", "StableRNGs", "StaticArrays", "Test"]
14 changes: 7 additions & 7 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ include("../examples/templates/smooth_template.jl")

# The `format` below makes it so that urls are set to "pretty" if you are pushing them to a hosting service, and basic if you are just using them locally to make browsing easier.

# DocMeta.setdocmeta!(StarFormationHistories, :DocTestSetup, :(using StarFormationHistories; import Unitful; import UnitfulAstro); recursive=true)
DocMeta.setdocmeta!(StarFormationHistories, :DocTestSetup, :(using StarFormationHistories); recursive=true)

# We check link validity with `linkcheck=true`, but we don't want this to fail the build so we add `:linkcheck` to `warnonly`.
# Additionally, we are setting `modules = [StarFormationHistories]` so a warning will be raised if any inline documentation strings are not included in the document.
# In v1.0 of Documenter, this warning will raise an error and prevent running. By adding `:missing_docs` to `warnonly`, we will see these warnings but they will not raise an error.
# We check link validity with `linkcheck=true`, but we don't want this to fail the build
# so we add `:linkcheck` to `warnonly`. Additionally, we are setting
# `modules = [StarFormationHistories]` so a warning will be raised if any inline
# documentation strings are not included in the document. In v1.0 of Documenter, this warning
# will raise an error and prevent running. By adding `:missing_docs` to `warnonly`, we will
# see these warnings but they will not raise an error.

makedocs(
sitename = "StarFormationHistories.jl",
Expand All @@ -44,7 +44,7 @@ makedocs(
"binaries.md",
"helpers.md",
"doc_index.md"],
doctest = true,
doctest = false,
linkcheck = true,
warnonly = [:missing_docs, :linkcheck]
)
Expand Down
Loading

0 comments on commit a93aecf

Please sign in to comment.