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

Documenting all exports from Base #26919

Closed
mbauman opened this issue Apr 27, 2018 · 15 comments
Closed

Documenting all exports from Base #26919

mbauman opened this issue Apr 27, 2018 · 15 comments
Labels
docs This change adds or pertains to documentation good first issue Indicates a good issue for first-time contributors to Julia help wanted Indicates that a maintainer wants help on an issue or pull request

Comments

@mbauman
Copy link
Member

mbauman commented Apr 27, 2018

It'd be nice to make sure that all our exports are documented and make sense for the 1.0 release. This is a fairly daunting list, but it is a task that's easily parallelizable and can be tackled incrementally.

There are two classes of undocumented thing.

  • It's just plain undocumented. Add documentation!
  • It's a callable thing and all its methods live within deprecated.jl. In this case, we probably want to @deprecate_binding the binding itself so packages that extend these methods won't be totally surprised when the binding gets removed in 1.0.

I've written a quick and simple script that identifies these two cases and spits out the list. Please feel free to jump in and add PRs to resolve these as you are able! Just be bold and go for it!

julia> searchdocs(mod) = searchdocs!(Any[], Bool[], mod)
       function searchdocs!(objs, isalldep, mod, seen=Set())
           mod in seen && return
           push!(seen, mod)
           for name in names(mod)
               isdefined(mod, name) || continue
               Base.isdeprecated(mod, name) && continue
               b = getfield(mod, name)
               docs = Base.Docs.doc(Base.Docs.Binding(mod, name))
               if startswith(string(docs), "No documentation found")
                   push!(objs, string(mod, '.', name))
                   push!(isalldep, !isempty(methods(b)) && all(x->occursin("deprecated", something(functionloc(x)[1],"")), methods(b)))
               end
               b isa Module && searchdocs!(objs, isalldep, b, seen)
           end
           objs, isalldep
       end
searchdocs! (generic function with 2 methods)

julia> objs, isalldep = searchdocs(Main)

julia> println("### Undocumented exports")
       foreach(x->println("* [ ] `", x, '`'), objs[.!isalldep])
       println("### Undocumented exports that are entirely deprecated")
       foreach(x->println("* [ ] `", x, '`'), objs[isalldep])

Undocumented exports (including module exports)

Edit: updated to remove the entirely-deprecated section

@mbauman mbauman added docs This change adds or pertains to documentation help wanted Indicates that a maintainer wants help on an issue or pull request labels Apr 27, 2018
@JeffBezanson
Copy link
Member

It's not straightforward to add a @deprecate_binding for every deprecated function, since the replacement is often non-trivial and/or doesn't have a name.

@fredrikekre
Copy link
Member

You don't get line numbers for @deprecate_binding either, usually just the module, which makes it almost impossible to track down location of where you need to update your code.

@KristofferC
Copy link
Member

I think

  Base.bin
  Base.dec
  Base.hex
  Base.oct

will be unexported after the deprecations are removed?

@mbauman
Copy link
Member Author

mbauman commented May 8, 2018

Those are missing a deprecation in intfuncs:

julia> methods(bin)
# 5 methods for generic function "bin":
...
[2] bin(x::Unsigned, pad::Int64, neg::Bool) in Base at intfuncs.jl:570
...

That's why they're getting put in the first list. Perhaps those methods should be deprecated, too?

@KristofferC
Copy link
Member

I thought they are just used internally for string of a number?

@mbauman
Copy link
Member Author

mbauman commented May 8, 2018

Ah, sure enough. The script isn't checking base/exports.jl — it's just using the method locations as a proxy for entirely deprecated. I suppose as long as those methods are undocumented that's okay, but it does strike me as a bit of a gray zone.

@fredrikekre
Copy link
Member

In this case, we probably want to @deprecate_binding the binding itself so packages that extend these methods won't be totally surprised when the binding gets removed in 1.0.

You don't get line numbers for @deprecate_binding either, usually just the module, which makes it almost impossible to track down location of where you need to update your code.

Would it be possible to print a warning when extending a totally deprecated function? If so, we can add another argument to @deprecate.

ChristianKurz added a commit to ChristianKurz/julia that referenced this issue Aug 16, 2018
add `Regex` documentation. (JuliaLang#26919)
ChristianKurz added a commit to ChristianKurz/julia that referenced this issue Aug 16, 2018
add `Regex` documentation. (JuliaLang#26919)
KristofferC pushed a commit that referenced this issue Aug 23, 2018
add `Regex` documentation. (#26919)
KristofferC pushed a commit that referenced this issue Aug 23, 2018
add `Regex` documentation. (#26919)

(cherry picked from commit 31c9ae9)
staticfloat pushed a commit that referenced this issue Aug 24, 2018
add `Regex` documentation. (#26919)
KristofferC pushed a commit that referenced this issue Sep 8, 2018
add `Regex` documentation. (#26919)

(cherry picked from commit 31c9ae9)
KristofferC pushed a commit that referenced this issue Sep 8, 2018
add `Regex` documentation. (#26919)

(cherry picked from commit 31c9ae9)
@himanshuladia
Copy link

Hey, I'm a newbie to Julia and want to contribute. Is this something I can help you with?

@timholy
Copy link
Member

timholy commented Oct 12, 2018

Sure! Just pick something from the list above that doesn't have a check next to it (and verify that it is still undocumented). Or run the searchdocs script in the OP.

KristofferC pushed a commit that referenced this issue Feb 11, 2019
add `Regex` documentation. (#26919)

(cherry picked from commit 31c9ae9)
@namanbiyani
Copy link

Hi, I was planning to contribute towards GSoC 2019. I want to contribute to this issue. Please give me some guidelines.

@KristofferC
Copy link
Member

Please don't write the same message in multiple issues.

This issue is about writing documentation so you would need to get familiar enough with the undocumented things in the first post and then write the actual documentation for them.

@namanbiyani
Copy link

Please tell me some exports which I should document

@mbauman
Copy link
Member Author

mbauman commented Feb 28, 2019

I've just updated the checklist. We're getting very close to closing this issue, so I decided to re-include things that aren't exported directly from Base but do get exported by submodules. Just grab a name and dig in. Note that the open PR #31131 addresses a few of the items, so don't do those.

@vtjnash
Copy link
Member

vtjnash commented Apr 20, 2021

This seems to have stalled, though someone could probably finish it in an afternoon

vtjnash added a commit that referenced this issue Apr 20, 2021
It seems like these were unintentional (and undocumented). Refs #26919.
vtjnash added a commit that referenced this issue Apr 21, 2021
It seems like these were unintentional (and undocumented). Refs #26919.
ElOceanografo pushed a commit to ElOceanografo/julia that referenced this issue May 4, 2021
It seems like these were unintentional (and undocumented). Refs JuliaLang#26919.
antoine-levitt pushed a commit to antoine-levitt/julia that referenced this issue May 9, 2021
It seems like these were unintentional (and undocumented). Refs JuliaLang#26919.
johanmon pushed a commit to johanmon/julia that referenced this issue Jul 5, 2021
It seems like these were unintentional (and undocumented). Refs JuliaLang#26919.
@mbauman
Copy link
Member Author

mbauman commented Jan 4, 2024

Superseded by #52725

@mbauman mbauman closed this as not planned Won't fix, can't repro, duplicate, stale Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This change adds or pertains to documentation good first issue Indicates a good issue for first-time contributors to Julia help wanted Indicates that a maintainer wants help on an issue or pull request
Projects
None yet
Development

No branches or pull requests

8 participants