mau013

mau013

Which Credo plugins are you using?

Hi everyone,

I have just added Credo to my project and I really liked it. I would like to take it a step further and implement further checks via plugins but I’m struggling to find a list of them… so my questions for you all are:

  1. Which Credo plugins are you using (if any)?
  2. Is the community gravitating towards a common set of checks other than those included in Credo itself?

Thanks a ton for any help.

Most Liked

D4no0

D4no0

This results in the same conclusion as the elixir formater arrived to:

The consistency over every random project you can open on the internet makes them more readable and easier to understand, simply because everyone formats/writes code in a similar style.

sodapopcan

sodapopcan

Adobe has some. I know there are others but none off the top of my head.

There are definitely a lot of style plugins that are up to personal taste and I think should stay that way, so I’d suggest looking through the disabled ones that come with Credo as there are some good ones! I particularly like the one that forces you to always pass the :async option to use ExUnit.Case. This way you can be relatively sure that whoever set it did so for a reason and didn’t absent-mindedly choose the default.

pdgonzalez872

pdgonzalez872

Default, not even having a credo file.

Just having something in place gets you 80% there, if not more. You get diminishing returns as you add more, the value it provides starts decreasing after a while, especially in big teams. Checks that are disabled/added because someone that left 3 years ago didn’t quite like it/or thought it was amazing at the time will haunt you later on.

IMO, your miles may vary.

sodapopcan

sodapopcan

Consistency, even within private projects, is the number one reason I care to use Credo, though the code suggestions are nice too since I don’t use any AI tools.

Big teams, period, is where the deminishing returns are :wink: If people are spending long periods of time arguing over what should go in Credo, or people are adding stuff without telling anyone, there are bigger problems at play. All that to say is that I generally agree the default is ideal, but for me the defaults are a little much and are just there to guard against juniors. Like:

Also stuff like “alias all the things” and “no single pipes” are things that are context-dependent AFAIC. Useful if you’re just letting anyone loose on your codebase, not for my own things.

katafrakt

katafrakt

I remember we have one custom to check if the migration version is a correct timestamp and if it’s not far in the future. The story behind it is that we had some people that liked to touch migration files by hand, without the generator, and at some point we have a migration with timestamp from the future, so every time you wanted to rollback your newly created migration, it rolled back that one instead.

Apart from that I sometimes advocate to have a check forbidding “full imports”. I used it as an example in this article. The check is not perfect IIRC, but bypassing it takes some dedication.

We also use checks from excellent_migrations, but lately I see many people disable them immediately in their migrations, so I guess we have to reevaluate.

Where Next?

Popular in Questions Top

LegitStack
I’m hoping you guys can give me some general advice and perhaps code examples if you’re feeling up to it. I’m very interested in Elixir,...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
johnnyicon
Hi all, I've just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I'm trying to use Postg...
New
kostonstyle
Hi all I want to have a unix time, from the current time plus 1 hour. DateTime.now + 1 hour How to get it in elixir? Thanks
New
Codball
Mix format works fine if run from the cmd. I’ve followed this to facilitate the implementation into VSC which involves downloading an ext...
New
jc00ke
Expanding on this topic: https://forum.elixirforum.net/t/map-typespec-question/19217 Let’s say I have a map with required and optional k...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New

Other popular topics Top

_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lis...
New
chensan
I have a User schema with a :from_id field set to type :string: defmodule TweetBot.Repo.Migrations.CreateUsers do use Ecto.Migration ...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
chrisalley
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
magnetic
Hey :wave:t3: Elixir community, I’ve been learning Elixir, and working on some side projects. My editor of choice is VSCode, and althoug...
New

We're in Beta

About us Mission Statement