Papillon6814

Papillon6814

Hi! I’m wondering if I should use formatter of elixir. I have never used any formatters in past projects.
So do you use formatter? And why do you use it?

First 10 of 41 Posts Switch mode

OvermindDL1

OvermindDL1

I still use the formatter even though I really really hate some of the things it does (like no trailing comma’s on multi-line things) just for consistency with what everyone else expects. I do the same with rust’s formatter and C++ formatting via clang and others as well. I may do some slight tweaks in configs (hard tabs instead of spaces because screw 3+width indentations when I’m in a terminal) when possible, but otherwise try to keep it as ‘vanilla’ as I can. It makes it easier for other people to look at and PR to your code.

dimitarvp

dimitarvp

For my Elixir, Rust, JavaScript, JSON and OCaml editing I use formatters even if I don’t like all of their decisions how things should look like.

Truth is, our code will be read by other people so I prefer to be a good citizen.

11
Post #2
dmitrykleymenov

dmitrykleymenov

For me it’s just a question of habit, more using formatter, more getting used to it and more loving things it does.

John-Goff

John-Goff

I love using the formatter, and specifically format on save in my editor, because it allows me to see if my code is right as it happens. If I save my file and everything snaps into place, I know I did things right. If it doesn’t, I know that I have a syntax error somewhere in the code I just wrote. Saves me from flicking back and forth to the server and my editor.

11
Post #4
dimitarvp

dimitarvp

Same, and I absolutely love it.

vinibrl

vinibrl

I use even though I don’t agree with every decision, but to maintain consistency. We also use mix format --check-formatted on CI to ensure the code is formatted.

a8t

a8t

yes. formatting is for computers to worry about, not me and certainly not a whole team. That’s the important part, the consistency.

ditto on using format-on-save to quickly let me know if I biffed it with a syntax blunder or something!

brightball

brightball

I do. I have it setup to run in VSCode on save and my team uses Committee to run it as a precommit hook.

APB9785

APB9785

Creator of ECSx

You all have inspired me to start using the format-on-save Atom plugin!

strzibny

strzibny

Yes, absolutely. We even fail CI build if the code is not formatted. My code is formatted in my editor on save.

Where Next? Top

Trending in Questions Top

stjefim
Hello! Suppose you are building workflow (order / task / payment) processing system with the following requirements: Each workflow con...
New
jonnycharles
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
dli
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app? Looking for hints regarding: Addi...
New
roeland
Kia ora, We have been using elixir-google-api to connect to Google Drive. However, with the updates to Tesla due to CVEs this is now bro...
New
bottlenecked
Hi all, I wanted to ask how the community is dealing with post-release steps. Today we have Ecto migrations, which make sure that the db...
New
rahultumpala
Hello, I have an Elixir backend that implements a custom protocol over TCP. I want to load test the backend and assess the performance o...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
type1fool
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New

We're in Beta

About us Mission Statement