fredrikekre / Runic.jl

A code formatter for Julia with rules set in stone.
MIT License
98 stars 3 forks source link

fix(readme): Add a test for empty file list in git hook. #26

Closed Klafyvel closed 3 months ago

Klafyvel commented 3 months ago

As it was, the proposed git hook will fail if no Julia file has been edited in the commit (for example if we only edited Project.toml).

fredrikekre commented 3 months ago

Thanks. I spent some time trying the other week to only run on the staged code too, not sure if there is a better way than

git stash -k
runic ...
# verify result (and stash changes automatically?)
git pop

Do you have any thoughts or ideas here? In particular I don't know if you are allowed to run git commands in a git hook.

Klafyvel commented 3 months ago

Do you have any thoughts or ideas here? In particular I don't know if you are allowed to run git commands in a git hook

I think I remember reading that git hooks are not supposed to apply changes to the files, but I don't remember where.