-
-
Notifications
You must be signed in to change notification settings - Fork 86
Add action and condition shorthands to simplify the configuration #277
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
base: main
Are you sure you want to change the base?
Conversation
e682c89 to
b0d397e
Compare
|
Nice feature! But: I would probably see things slightly differently when the shorthand would somehow be extracted from the fully qualified class name so that the FQCN and the shorthand van be converted into one another by a ruleset rather than a mapping. Or when the shorthand would be defined in the respective class e.g. via a In both cases the shorthand documentation could be automatically generated without forgetting a manual process when introducing the next rule. Also: Why {
"action": "CaptainHook.Message.MustFollowBeamsRules",
}and not {
"action": "CaptainHook.App.Hook.Message.Action.Beams"
}Kind of the same as now but without the clunky backslashes... Just my 0.02€ |
|
Very good points, especially the manual sync and how to find the shorthand. I would update the documentation and all the examples to mainly include the shorthands, but you are right, if you don't want to look it up and see the class file it's kind of annoying to check the If we add the shorthand to the class, an idea that I like, how do we find the class efficiently without instantiating all the classes, on the other hand I don't want people to think they can add shorthands to their Do you think adding something like that to every /**
* Example configuration:
*
* "action": "some-action"
* "conditions": [
* {"exec": "CaptainHook.Config.CustomValueIsFalsy",
* "args": [
* "NAME_OF_CUSTOM_VALUE"
* ]}
* ]Regarding
|
330e984 to
92b3e0f
Compare
Adding an example configuration to the class DocBlock and a 'short' DocBlock-Tag.
92b3e0f to
78871dd
Compare

Over the last couple of versions I tried to slim the minimal required configuration down a bit.
But for internal features the action configuration still feels a bit messy.
I want to move from
To this
Similarly for the internal
Conditions.What do you think? Unnecessary or cool feature?
Feedback welcome :)