DEV Community

Discussion on: Can forced linting surpress contributions when linting is first introduced?

Collapse
 
cher profile image
Cher

If the linting can be auto-fixed on pre-commit, it's valuable. It removes negative nit comments that may deter people from contributing. If they can't be fixed with a linter, I'd question the validity of the style preference from outside--and instead defer any linting failures to be fixed by regular contributors.

Collapse
 
suprnova32 profile image
Patricio Cano

This is why I love the Elixir formatter. When you run it, it automatically fixes any offenses. You can add it as a pre-commit hook and your work will always be formatted. You can also run a check on CI to make sure all code is formatted.

I like that it is really opinionated and not really configurable. It gives you a style guide for the entire Elixir ecosystem.

Iโ€™d wish there was something like this for Ruby. Rubocop can be such a pain...

Collapse
 
jf1 profile image
Jed Fox

Check out Prettierโ€™s Ruby plugin:

github.com/prettier/plugin-ruby

Thread Thread
 
suprnova32 profile image
Patricio Cano

I've heard about Prettier before, but it is still not quite the same as the Elixir formatter. For Elixir, it is a part of the language, and many libraries use it. This means that there is a cohesiveness in most Elixir codebases.

Ruby, while it does have some efforts, does not have a formatter as a core part of the language.