JuliaWeb / GitHub.jl

A Julia package for interfacing with GitHub
MIT License
172 stars 60 forks source link

@api_default macro removes line info #151

Open KristofferC opened 5 years ago

KristofferC commented 5 years ago
julia> m = @which GitHub.pull_request(Repo("JuliaLang/julia"), 33779)
pull_request(repo, pr) in GitHub

In general, the '@api_default` is pretty annoying. It needs to be put on all methods and I don't see how it is better than just using a global or a keyword arg with a default value or something more normal.

simonbyrne commented 5 years ago

My guess is that it's because it's the first argument, so writing these is somewhat cumbersome?

On a somewhat related note, I would actually like to change the interface so that auth and headers are included as part of the GitHubAPI object (since they tend not to change between requests). In which case we could make it non-optional?

KristofferC commented 5 years ago

The argument got introduced at the same time as the macro though.

Yeah, writing auth all the time (and then forgetting it somewhere causing rate limits sometimes) is also kinda annoying.