-
Notifications
You must be signed in to change notification settings - Fork 418
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
Custom check shipped with lib not loading #1068
Comments
Here is a sample project which loads a demo plugin which brings its own check. I think this demonstrates what you are trying to do, right? If you are still having problems, can you create a minimal reproducible example? |
yea this assumes that it s all in the same repo that example. I ll see if i can build a minimal repro next week |
So, you have (a) a plugin in one repo, (b) a check in another repo and (c) a project where this should come together? |
I have a lib that define the plugin and includes custom checks |
And how is this different from the example linked above? |
so I guess the setup is similar but I don t want the sample project to load the custom check. I put the require and the custom check in the demo plugin. So I was hoping not to have to have every application to have to enable the custom check in their credo file. so I would say try to move the require and the custom check enabling in the plugin instead and that should about what I have |
And you don't have to (again: see the linked example above). I would very much like to help you (again: can you put something online that reproduces this error, so I can look at it?). |
there you go! clone both https://github.com/epinault/credo_sample_project and https://github.com/epinault/credo_demo_plugin if you run mix credo,, you ll noticed I added a debug that show it s never running the Better check |
|
The demo plugin teaches you to
You seem to have used that demo plugin, wanting to use the first point and have not stripped out the code responsible for the last three points. Therefore, when you type Did you never think "Why is it printing 'By the power of !'??" ... |
I did not realize this plugin was also doing another command. I ll modify once more the code to reflect more my project . let me fully get a commit for those repo that reflect and remove that CLI command |
meanwhile would you mind looking at #1069 since really that would solving my problem if that was part of credo already anyway |
ok so I can see it working . I am not sure why it was not working on mh other project but once I clobber my plugin package then it started to behave again correctly. Though both were using the exact same plugin and using path: to point to it.. I wonder if there is an issue around hex and some caching using path at time. I literally had the same config between those project another one. and only thing that made it work was doing a mix deps.clean my_plugin |
Environment
mix credo -v
): 1.7.xelixir -v
): 1.14.xWhat were you trying to do?
I creating a credo plugin (that is really close to the example), and trying to ship also custom check as part of the plug into the same package
Then I am trying to use the plugin and that custom check in an application. I was hoping to define the new check as part of the plugin to load so I don t have to define anything in the application
So say I have MyApp as application, and my Plugin is a separate package called MyCredoPlugin
MyCredoPlugin .credo.exs file has this
Expected outcome
I would expect the plugin to be enabled and running by default the new check. and see bunch of output that I know MyApp will trigger
Actual outcome
it s not running the check though it is loading the plugin correctly.
In order the enable that custom check. I had to add it to my .credo.exs inside the MyApp folder as such
By the way I will likely send an MR for this check if you are interested in it.
The text was updated successfully, but these errors were encountered: