webuhu

webuhu

Avoid the creation of .formatter.exs on new projects

As I find it very important to keep our “Elixir Project Structure” clean,
so I would suggest to start a discussion about,
if we should try to avoid creating .formatter.exs on new Elixir projects.

I personally use in my projects just the following within my mix.exs file:

defp aliases do
  [
    format_all: "format \"mix.exs\" \"{lib,test}/**/*.{ex,exs}\""
  ]
end

Post which brought me to think about the project structure topic: pragdave.me

Most Liked

Phillipp

Phillipp

That simply does not make sense for me.

We have two use cases here:

  1. Wants to use the formatter
  2. Does not want to use the formatter

If there is no .formatter.exs, all the people who would like to use it, have to google for the supposed content of the file.

If someone does not want to use it, they can simply ignore the file or delete it.

This requested change creates a bigger amount of work for the usecase of the majority of users. While your “edge-case” requires little to no effort to archive the goal on your project.

NobbZ

NobbZ

Personally, I prefer to keep this file, as it not only specifies which files to include in formatting, but also specifies which external or internal formatting rules I want to use to keep or omit parens.

Phillipp

Phillipp

Well, I guess quite a lot of people use the elixir formatter and would like to have a config for it. It’s way easier to delete the file if you don’t need it than to look up it’s supposed content if you want it.

Where Next?

Popular in Discussions Top

pillaiindu
In django there is a cache framework backed by memcached. Rails also puts a lot of emphasis on caching, and even the idea of russian-doll...
New
pillaiindu
I want to convert a Phoenix LiveView CRUD website to a CRUD mobile app. What do you think is the easiest way to do so?
New
lorenzo
Hey everone! I created a prototype for my app using Nodejs for the api. But the framework I chose wasnt great (in general theresnt any g...
New
nburkley
AWS re:Invent is on at the moment with some interesting announcements. One new feature in particular is the Lambda Runtime API for AWS La...
New
New
tomekowal
Hey guys! I want to create a toy project that shows a chart of temperature over time and updates every 5 seconds. I feel LiveView is per...
New
griffinbyatt
Sobelow Sobelow is a security-focused static analysis tool for the Phoenix framework. For security researchers, it is a useful tool for g...
New
New
MarioFlach
Hello, I want to share a project I’ve been working on for a while: https://github.com/almightycouch/gitgud Background Some time ago I ...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

Other popular topics Top

sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
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
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
klo
Got a question about when to concat vs. prepending items to list then reversing to achieve appending. So i know lists boil down to [1 | ...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
AstonJ
We’ve put together this wiki for Phoenix LiveView - please feel free to add any info you feel is worth including. What is Phoenix LiveV...
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New

We're in Beta

About us Mission Statement