Tom Morris on Nostr: Was setting up a pre-commit hook to autoformat Nix code. If you just run `nix fmt` in ...
Was setting up a pre-commit hook to autoformat Nix code. If you just run `nix fmt` in the CLI it autoformats only .nix files. The Pre-commit framework passes a list of files, and unless you specifically write a regex to only limit it to .nix files, it'll pass every changed file (not reasonable).
`nix fmt` will take things that definitely are not Nix files and do wild stuff with them—YAML files, Makefiles, random shell scripts. So, yeah, then you need to pull the unbroken versions out of GIt.
`nix fmt` will take things that definitely are not Nix files and do wild stuff with them—YAML files, Makefiles, random shell scripts. So, yeah, then you need to pull the unbroken versions out of GIt.