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

Streamline custom commands #362

Merged
merged 6 commits into from
May 24, 2024
Merged

Conversation

Omnikron13
Copy link
Contributor

Summary

Moved common functionality from runCustomPRCommand() & runCustomIssueCommand() into new runCustomCommand() function

How did you test this change?

Set and ran rudimentary custom commands in each context. Could probably do with some more robust testing though tbh.

I've left an empty input map still initialised in the new function, and merged in the specific data from the calls from different contexts, as I'm not sure what common data might want to be made available common to different contexts.

Omnikron13 and others added 6 commits April 18, 2024 00:00
Removes an assumption that specific data/keys are required by the bound
command.

Instead `Template.Option()` is used to tell the Template to error out if
and when it actually encounters a key it needs.
Unfortuneatly it seems the Template options are a little lacking, and
I don't believe can be persuaded to accept zero values or even nil
pointers as 'missing' values.

The struct in question, `PRCommandTemplateInput`, appears to have no use
elsewhere however, so was easily replaced with a map, which I hope
serves your needs for the near future at least.
@Omnikron13
Copy link
Contributor Author

Following the calls back, could drop runCustomPRCommand() & runCustomIssueCommand() too I suppose, unless there's likely to be extra logic there that doesn't want to be polluting executeKeybinding().

@dlvhdr dlvhdr merged commit 4bcaec0 into dlvhdr:main May 24, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants