CodeFaster

CodeFaster

Share this post

CodeFaster
CodeFaster
Don't use pre-commit hooks

Don't use pre-commit hooks

Tyler Adams's avatar
Tyler Adams
Jul 26, 2024
∙ Paid
1

Share this post

CodeFaster
CodeFaster
Don't use pre-commit hooks
2
Share

A couple of companies ago, I had a report that wanted to prettify our whole codebase. His idea? Prettier in pre-commit hooks! That way, you write, commit and it’s pretty. Pretty awesome right…

CodeFaster is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.

Nope.

This works in a narrow use case. You write a change and commit everything you just wrote. This is, in my experience is not at all how I use git. I’ll make a bunch of changes and commit…some of them. There’s 2 reasons I do this:

  • I’ll never commit some changes like adding logs, custom builds, removing flaky tests

  • I break up my changes into lots of small commits. Often times my creation process is super messy. I don’t really know what I’m doing until it’s done. But once it’s done, then it’s clear how to break the change up into bite size commits to make a clean history that’s easier to bisect and analyze for future developers.

Prettier sadly works on not the diff bu…

This post is for paid subscribers

Already a paid subscriber? Sign in
© 2025 Tyler Adams
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share