This package looks really cool! I was looking at it and thought that for Makie.jl use and others it may need user extensibility. Have you considered a struct-based approach, where each check is a type, and some common API method is defined for that type?
Something like this:
abstract type AbstractDocstringCheck end
struct CheckNonEmpty <: AbstractDocstringCheck end
function check(::CheckNonEmpty, ::Symbol, ::Dict, raw::String, ::Any)::Union{ShortIssue, Vector{ShortIssue}}
if all(isspace, raw)
ShortIssue(:error, "The documentation string should not be empty"), true
end
end
or something like this. Then users can call check(module; checks = AbstractDocstringCheck[...]) and define their own checks elsewhere!
This package looks really cool! I was looking at it and thought that for Makie.jl use and others it may need user extensibility. Have you considered a struct-based approach, where each check is a type, and some common API method is defined for that type?
Something like this:
or something like this. Then users can call
check(module; checks = AbstractDocstringCheck[...])
and define their own checks elsewhere!