You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I have a question regarding the plugin API. I use a basic plugin that basically load a default config file. plugin is then configured and used and works correctly. So does something like
I am trying to expand that plugin to allow more dynamic behavior, especially with regards of the being to add custom check dynamically.
When I try to modify the Execution returned by the plugin, it does not seems to take any effects at all (say for example to try to see if that would work I turned off all check on a repo where the check would currently flag) but it s not working
I have tried a different approach by using append_task at different part of the webhooks, but again modifying the checks, seems to have no effects
So I am wondering if its even possible to modify them after the register_default_config(exec, @config_file). I don t even see an api to modify the checks but since the Execution is just a struct, I thought I could modify it somehow in the pipeline .. but not working . Do you have a suggestion on how we could approach this to make it work? what am I missing?
Only thing I can think off is modifying the file dynamically prior to calling the register (but that means doing Code.eval_file etc... )
Expected outcome
Need a way to add dynamically some plugin based on configuration passed to the plugin
Actual outcome
The text was updated successfully, but these errors were encountered:
your example does not work because Credo's loading and validating of checks runs after your code. So your change to the exec struct is simply overwritten.
You can probably achieve what you are describing by prepending your task to :run_command (so the task you register is running before the called Credo command):
Environment
mix credo -v
): 1.7.7elixir -v
): 1.16.3What were you trying to do?
Hello, I have a question regarding the plugin API. I use a basic plugin that basically load a default config file. plugin is then configured and used and works correctly. So does something like
I am trying to expand that plugin to allow more dynamic behavior, especially with regards of the being to add custom check dynamically.
When I try to modify the Execution returned by the plugin, it does not seems to take any effects at all (say for example to try to see if that would work I turned off all check on a repo where the check would currently flag) but it s not working
or
And MyCustomTask would be basically in the call callback, do similar thing to manipulate the checks
I have tried a different approach by using append_task at different part of the webhooks, but again modifying the checks, seems to have no effects
So I am wondering if its even possible to modify them after the
register_default_config(exec, @config_file)
. I don t even see an api to modify the checks but since the Execution is just a struct, I thought I could modify it somehow in the pipeline .. but not working . Do you have a suggestion on how we could approach this to make it work? what am I missing?Only thing I can think off is modifying the file dynamically prior to calling the register (but that means doing Code.eval_file etc... )
Expected outcome
Need a way to add dynamically some plugin based on configuration passed to the plugin
Actual outcome
The text was updated successfully, but these errors were encountered: