The returned response from `api.EndpointNeedsScopes` causes `bodyclose`
linter to raise a false positive error, assuming it's a new response that
its body needs to be closed.
Signed-off-by: Babak K. Shandiz <babakks@github.com>
This commit converts all of the places using ColorScheme.Gray and ColorScheme.Grayf to Muted and Mutedf.
There is a little extra tidying up with local variable names or converting code to use Mutedf format.
* Separate partitioning from globbing in cmdutil/args package and consumers
In the previous commit, GlobPaths was overloaded, containing logic
specific to command use-cases. This commit removes that functionality from
GlobPaths and back into the commands that have the special use-cases.
To do this, I've introduced a new Partition util in cmdutil/args.go that
will separate a slice into two slices given a predicate. This functionality
is leveraged by both the special use-cases described above to separate the
command-specific syntax from the globable filepaths.
* Add test to validate that the order of '-' in gh gist create args doesn't matter
If a 4xx server response lists scopes in the X-Accepted-Oauth-Scopes
header that are not present in the X-Oauth-Scopes header, the final
error messaging on stderr will now include a hint for the user that they
might need to request the additional scope:
$ gh codespace list
error getting codespaces: HTTP 403: Must have admin rights to Repository. (https://api.github.com/user/codespaces?per_page=30)
This API operation needs the "codespace" scope. To request it, run: gh auth refresh -h github.com -s codespace
This removes sensitivity to the BROWSER environment variable in tests
and makes it easier to verify the URL that the browser was invoked with
without having to stub sub-processes.
* Support for --web when using gist create
Proposal to close#2071
I have not worked with Go prior to this so please smite me down with the
wisdom of a million Golang gods if I'm doing something terribly wrong.
I also added a test to gist/create for the added web arg.
Pretty much referenced the implementation from pr/create.
* Fix for Tests / build (windows-latest)
I believe this fixes it as it stopped failing on a local vm. Otherwise I
will try and tackle it tomorrow.
* minor cleanup
Co-authored-by: vilmibm <vilmibm@github.com>