octokit.net icon indicating copy to clipboard operation
octokit.net copied to clipboard

Support for negative qualifiers

Open kiriwalawren opened this issue 6 years ago • 3 comments

GitHub API V3 has a functionality where a - can be placed in front of a qualifier to negate its function.

  • extension:sql - Look in files with the sql extension
  • -extension:sql - Look in file that are not sql files

I think this would be great functionality to have in octokit.net.

kiriwalawren avatar Oct 01 '19 16:10 kiriwalawren

As the - syntax works for all string based search qualifiers, should we add them all at the same time?

hnrkndrssn avatar Oct 04 '19 07:10 hnrkndrssn

Before going too deep on this, I want to call out two things:

  • the work required to generate each search URL is already complex, and adding support for negation will potentially double the internals required e.g.

https://github.com/octokit/octokit.net/blob/3e7c70cf4e38ea29fd778cdc7bfb65ea4f88e8b5/Octokit/Models/Request/SearchCodeRequest.cs#L160-L228

  • What should the user-facing API for this look like? We want to avoid breaking existing callers, if at all possible, but if breaking API changes are unavoidable I'd love to instead make this a new client API that we can experiment to then bake and figure out migration

shiftkey avatar Oct 04 '19 11:10 shiftkey

My initial (though quite brief) thoughts were to just add additional properties for qualifiers to exclude, e.g. ExcludedExtensions but after thinking about it a bit more and seeing the first of your thoughts I agree that it would add unnecessary complexity to an already complex implementation.

hnrkndrssn avatar Oct 04 '19 12:10 hnrkndrssn

👋 Hey Friends, this issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please add the Status: Pinned label if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!

github-actions[bot] avatar Jul 26 '23 01:07 github-actions[bot]