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

Fix spurious "Package.Package missing" warnings #1009

Merged
merged 2 commits into from
May 8, 2019
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

* ![Bugfix][badge-bugfix] URLs for files in the repository are now generated correctly when the repository is used as a Git submodule in another repository. ([#1000][github-1000], [#1004][github-1004])

* ![Bugfix][badge-bugfix] When checking for omitted docstrings, Documenter no longer gives "`Package.Package` missing" type false positives. ([#1009][github-1009])

## Version `v0.22.3`

* ![Bugfix][badge-bugfix] Fixed filepaths for images included in the .tex file for PDF output on Windows. ([#999][github-999])
Expand Down Expand Up @@ -308,6 +310,7 @@
[github-1000]: https://github.com/JuliaDocs/Documenter.jl/issues/1000
[github-1002]: https://github.com/JuliaDocs/Documenter.jl/pull/1002
[github-1004]: https://github.com/JuliaDocs/Documenter.jl/pull/1004
[github-1009]: https://github.com/JuliaDocs/Documenter.jl/pull/1009

[documenterlatex]: https://github.com/JuliaDocs/DocumenterLaTeX.jl
[documentermarkdown]: https://github.com/JuliaDocs/DocumenterMarkdown.jl
Expand Down
18 changes: 15 additions & 3 deletions src/DocChecks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,22 @@ function missingdocs(doc::Documents.Document)
@debug "checking for missing docstrings."
bindings = allbindings(doc.user.checkdocs, doc.user.modules)
for object in keys(doc.internal.objects)
if haskey(bindings, object.binding)
signatures = bindings[object.binding]
# The module references in docs blocks can yield a binding like
# Docs.Binding(Mod, :SubMod) for a module SubMod, a submodule of Mod. However, the
# module bindings that come from Docs.meta() always appear to be of the form
# Docs.Binding(Mod.SubMod, :SubMod) (since Julia 0.7). We therefore "normalize"
# module bindings before we search in the list returned by allbindings().
binding = if Documenter.DocSystem.defined(object.binding) && !Documenter.DocSystem.iskeyword(object.binding)
m = Documenter.DocSystem.resolve(object.binding)
isa(m, Module) && nameof(object.binding.mod) != object.binding.var ?
Docs.Binding(m, nameof(m)) : object.binding
else
object.binding
end
if haskey(bindings, binding)
signatures = bindings[binding]
if object.signature ≡ Union{} || length(signatures) ≡ 1
delete!(bindings, object.binding)
delete!(bindings, binding)
elseif object.signature in signatures
delete!(signatures, object.signature)
end
Expand Down