-
-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[feature] add a custom hint for failing actions #173
Comments
I would suggest something like this.
What do you think? |
I thought about adding it into Maybe I am wrong and there already exists generic options; in this case, your suggestion would be the way to go. |
I thought a little bit about it and I think creating a dedicated CLI-Action is the way to go.
|
I like the idea of a dedicated and explicit CLI-Action. It would allow very specific customization. For exapmple, we could even imagine something like "actions": {
{
"action": "\\CaptainHook\\App\\Hook\\Cli\\Action\\Advanced",
"options": {
"command": "ls -lisa",
"hints": [
"-1": "default hint",
"1-13": "some hint for error codes betweek 1 and 13"
],
"acceptableErrorCodes": [0, 14, 773]
}
}
} Note: this is an advanced usage, and I would go for it ina firts run, but it was just an example of how CLI-Action would allow more things in the future. |
Yes that would be the point, we could allow more features over time without messing with the Cap'ns core settings. |
In some companies, or communities, code rules are detailed in custom documentation. For example, in my compani, we have a comprehensive code style redacted and hosted in our internal wiki.
When lint action fails, I'd like to add a message like this:
I'd suggest to add a
hint
section in actions, accepting:Note: I was wondering if accepting a custom callable would be useful, and I am not against it, but if you are about to write custom code, why not writing the full action in custom code, and thus you do not need the
hint
section.If this sounds a reasonable feature to you, I am willing to contribute with a PR.
The text was updated successfully, but these errors were encountered: