• 0 Posts
  • 3 Comments
Joined 1 year ago
cake
Cake day: August 23rd, 2025

help-circle


  • I heavily use githooks to let everyone have their cake and eat it too. Eg:

    Git post checkout hook converts something i don’t like to how i prefer it

    Do some things

    Git pre-commit hook converts my preferred thing back to the format as committed.

    Usually i can do these with a one-liner from some combination of jc, jq, yq, and yamlfmt and for everything else there’s sed. If there’s a linter or formatter in the repo I’ll run those in a pre commit hook after all my stuff. The best part is it just takes an executable so you can write it in anything you can shebang, compile, or interpret.

    JC is underrated and YQ i avoid for most cases but it’s quite good with comment handling and preservation