mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
1978176c22
That script can be used to ensure that all commited V files are vfmt-ed, i.e. it will run `v fmt -w ` on them before commiting them. To use the script in your V project, you need to be in the main folder of your project, then do the equivalent of: ```sh cp /PATH/TO_YOUR/V/cmd/tools/git_pre_commit_hook.vsh .git/hooks/pre-commit chmod 755 .git/hooks/pre-commit ``` Note: you can use this command: `git config --bool --add hooks.stopCommitOfNonVfmtedVFiles true` ... to make it just *prevent* the commiting of unformatted .v files, i.e. stop the commiting, if they are not, but *without modifying them* automatically (you will then need to run `v fmt -w` on them manually). Note 2: Git supports the option `--no-verify`, to temporarily disable all hooks. |
||
---|---|---|
.. | ||
tools | ||
v |