CodeFaster

Share this post
Don't put autofixers in precommit
codefaster.substack.com

Don't put autofixers in precommit

Tyler Adams
Dec 3, 2021
2
2
Share this post
Don't put autofixers in precommit
codefaster.substack.com

Autofixers in precommit are stupid because they break a fundamental rule of version control: “What you get out of it must be what you put into it” (as coined by Linus). I’ll push this idea in a new direction and say if you use an autofixer in precommit, the VCS (Version Control System), by definition changes what you put into it.

If you ever feel you should use an autofixer in precommit:

1 - Lie down until the feeling passes.

2 - Add a checker to premerge checks.

The 2nd point is key. Autofixers are great and you should use them. Code in trunk should maintain the property that autofixers are a no-op on them. If not, the code is not ready to be merged to trunk. But you have to make sure what you get out of VCS is exactly what you put into it. So, don’t add the autofixer in precommit.

2
Share this post
Don't put autofixers in precommit
codefaster.substack.com
2 Comments

Create your profile

0 subscriptions will be displayed on your profile (edit)

Skip for now

Only paid subscribers can comment on this post

Already a paid subscriber? Sign in

Check your email

For your security, we need to re-authenticate you.

Click the link we sent to , or click here to sign in.

Andrew Judson
Writes Andrew’s Newsletter Dec 8, 2021

Could you do both precommit autofix and premerge check?

Expand full comment
ReplyCollapse
1 reply by Tyler Adams
1 more comments…
TopNewCommunity

No posts

Ready for more?

© 2022 Tyler Adams
Privacy ∙ Terms ∙ Collection notice
Publish on Substack Get the app
Substack is the home for great writing