I recommend the server-side `update` hook (much like `pre-receive`, but a little easier to use and more flexible).
Here's an example with Prettier:
https://coolaj86.com/articles/server-side-git-hooks-for-code...
AJ ONeal (@coolaj86), the Lead Software Engineer at SpotterRF and Web-Technologist at large. Avid member of the Open Source community in Utah, especially JavaScript- / HTML5-related stuff, including the JavaScript Jabber podcast. I DJ parties and weddings on the side and am also connoisseur of fine cheeses.
[ my public key: https://keybase.io/coolaj86; my proof: https://keybase.io/coolaj86/sigs/kOg6GQ1QPmdIEqOX-yMOxs4uMeW1fd0ZPDrgocCAmQs ]