Here's an example with Prettier:
https://coolaj86.com/articles/server-side-git-hooks-for-code...
Having used both extensively, my biggest grievances (in order) are that there aren't more editors that with good on-save support, that black is relatively slow (compared to gofmt), and that black isn't more opinionated and less configurable.
Here’s a reference:
https://github.com/LibraryOfCongress/coding-standards
The CI check can be pretty simple — for example: https://github.com/LibraryOfCongress/concordia/blob/2f813f18...
black --diff
black --check
The first one shows you what's different (so you have logs in your build job), the second one fails your job if there are any diffs. You could just do the second one if you're a fan of the whole brevity thing.