typstfmt
typstfmt copied to clipboard
chore: add `.pre-commit-hooks.yaml`
Can you say why we need this?
Sorry for your confusion, you could refer to my explanation in an similar PR for another typst formatter:
https://github.com/Enter-tainer/typstyle/pull/91#issuecomment-2162852338
In short by this change typstfmt can be automatically run every time before commiting
Ah, so its some config that people reference from their repos to keep things in check. Ok, how does it build typstfmt then? Or does it just assume its in their path?
pre-commit creates a virtual environment and installs it there (as I specified rust), so there is no need for the user to manually install it. Although I am not sure what specific commands are used.
.pre-commit-config.yaml:
repos
- repo: https://github.com/34j/typstfmt
rev: "872b6b9"
hooks:
- id: typstfmt
pipx install pre-commit
pre-commit run -a
1-2 minute(s) later
Thanks for the explanation!