Comments (14)
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?
from credo.
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
from credo.
yea this assumes that it s all in the same repo that example.
So, you have (a) a plugin in one repo, (b) a check in another repo and (c) a project where this should come together?
from credo.
I have a lib that define the plugin and includes custom checks
then I have an app that use that lib to configure credo and run the check defined by that lib
from credo.
And how is this different from the example linked above?
from credo.
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
from credo.
So I was hoping not to have to have every application to have to enable the custom check in their credo file.
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?).
from credo.
there you go!
clone both https://github.com/epinault/credo_sample_project and https://github.com/epinault/credo_demo_plugin
both in the same dir
if you run mix credo,, you ll noticed I added a debug that show it s never running the Better check
from credo.
If I run mix credo suggest
I get this:
Do you get another result?
from credo.
❯ elixir -v
Erlang/OTP 25 [erts-13.2.2.1] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1] [jit]
Elixir 1.14.5 (compiled with Erlang/OTP 24)
❯ mix credo --help
Credo Version 1.7.0-ref.master.7179615+uncommittedchanges
Usage: $ mix credo <command> [options]
credo_sample_project on master is 📦 v0.1.0 via 💧 on ☁️ (us-west-2) took 2s
❯ mix credo
By the power of !
```
only difference I see is you use suggest? I have it all over my CI or running locally as this
```
mix credo --strict
```
and now i see this error
❯ mix credo --strict
** (credo) Unknown switch for `demo` command: --strict
yet the lock file says
```
"credo": {:hex, :credo, "1.7.0", "6119bee47272e85995598ee04f2ebbed3e947678dee048d10b5feca139435f75", [:mix], [{:bunt, "~> 0.2.1", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "6839fcf63d1f0d1c0f450abc8564a57c43d644077ab96f2934563e68b8a769d7"},
```
from credo.
The demo plugin teaches you to
- add a config (for a check provided by the plugin)
- register a new command
- register a CLI switch to configure that command and
- set that command as the "default command"
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 mix credo
, it does not do what you think.
Did you never think "Why is it printing 'By the power of !'??" ...
from credo.
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
from credo.
meanwhile would you mind looking at #1069 since really that would solving my problem if that was part of credo already anyway
from credo.
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
from credo.
Related Issues (20)
- NoAmbiguousAliases fails on function param with name alias HOT 3
- "Most of the time you are using the multi-alias/require/import/use syntax..." with compile_env HOT 4
- Gracefully handle output of bitstring `:message` in `%Credo.Issue{}` HOT 8
- False positive: spec in quoted HOT 3
- False Positive: Macro sigils with uppercase words HOT 4
- `UnusedKeywordOperation` check should ignore `Keyword.validate!/2` HOT 4
- Arguable advice from `Credo.Check.Refactor.AppendSingleItem` HOT 1
- Predicate function names should not start with 'is', and should end in a question mark flagged for :ets.whereis HOT 2
- Not ready for Elixir 1.16: a lot of 'warning: negative steps are not supported in Enum.slice/2 HOT 1
- Elixir 1.17 issues HOT 7
- Dependency divergence on compile HOT 2
- Unicode characters (arrows) that indicate priority of found issues not printed correctly HOT 2
- Credo.Check.Warning.Dbg: doesn't warn when using `&dbg/1`
- Error `mix credo` on Elixir 1.17 and Erlang/OTP 27 HOT 4
- Credo.Check.Design.SkipTestWithoutComment and many others, fail to run (Elixir 1.17 issue?) HOT 1
- Error upgrading project to Elixir 1.17 HOT 3
- Detect ambiguity in function calls without parentheses HOT 1
- Regression in 1.7.7 leading to false positive of Credo.Check.Readability.FunctionNames HOT 3
- Question around the plugin HOT 2
- `Credo.Check.Warning.UnsafeToAtom` warning on compile time created atom HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from credo.