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

Checks overhaul #58

Closed
gdude2002 opened this issue Jun 30, 2021 · 2 comments
Closed

Checks overhaul #58

gdude2002 opened this issue Jun 30, 2021 · 2 comments
Assignees
Labels
Type: Enhancement Improvements to existing features.

Comments

@gdude2002
Copy link
Member

As it stands, checks are pretty simple and there's a lot of power in their simplicity. However, there are some situations where checks are not enough, and the user needs to have a message returned to them.

This issue proposes a new style of checks - very similar to the current style, they would simply take an event and return a value. However, that value should be a CheckResult rather than a boolean - this would allow check developers to specify a message or translation key to be returned to the user, if the check fails.

This should be configurable on a per-command and per-extension basis as well.

@gdude2002 gdude2002 added the Type: Enhancement Improvements to existing features. label Jun 30, 2021
@gdude2002 gdude2002 self-assigned this Jun 30, 2021
gdude2002 added a commit that referenced this issue Jul 13, 2021
@gdude2002
Copy link
Member Author

I decided to take a different approach to this, as CheckResult was cumbersome and a lot of extra context had to be passed around. Instead, checks now make use of a CheckContext type deal, with pass and fail functions available.

This is in 1.4.3-SNAPSHOT, and it'd be great if people would try it.

@gdude2002
Copy link
Member Author

This is now in a release version, so I'll consider it good. Feel free to open another issue if there are problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Improvements to existing features.
Projects
None yet
Development

No branches or pull requests

1 participant