mirror of
https://github.com/vlang/v.git
synced 2025-09-14 06:52:36 +03:00
tools: fix typos (#19546)
This commit is contained in:
parent
491b5f7614
commit
2332c17bea
14 changed files with 38 additions and 38 deletions
|
@ -3,8 +3,8 @@
|
|||
import os
|
||||
import term
|
||||
|
||||
// This script can be used to ensure that all commited V files are vfmt-ed automatically.
|
||||
// By default, once setup, it will run `v fmt -w` on them, before commiting them.
|
||||
// This script can be used to ensure that all committed V files are vfmt-ed automatically.
|
||||
// By default, once setup, it will run `v fmt -w` on them, before committing 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:
|
||||
|
@ -15,8 +15,8 @@ import term
|
|||
//
|
||||
// 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*
|
||||
// ... to make it just *prevent* the committing of unformatted .v files,
|
||||
// i.e. stop the committing, 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 skipping the hooks, by passing the `--no-verify` option.
|
||||
|
@ -24,7 +24,7 @@ import term
|
|||
// the hook.
|
||||
|
||||
fn main() {
|
||||
// This hook cares only about the changed V files, that will be commited, as reported by git itself:
|
||||
// This hook cares only about the changed V files, that will be committed, as reported by git itself:
|
||||
changed := os.execute('git diff --cached --name-only --diff-filter=ACMR -- "*.v" "*.vsh" "*.vv"')
|
||||
|
||||
all_changed_vfiles := changed.output.trim_space().split('\n')
|
||||
|
@ -43,8 +43,8 @@ fn main() {
|
|||
eprintln('>>> 0 changed V files, that may need formatting found.')
|
||||
exit(0)
|
||||
}
|
||||
configured_stop_commiting := os.execute('git config --bool hooks.stopCommitOfNonVfmtedVFiles')
|
||||
if configured_stop_commiting.output.trim_space().bool() {
|
||||
configured_stop_committing := os.execute('git config --bool hooks.stopCommitOfNonVfmtedVFiles')
|
||||
if configured_stop_committing.output.trim_space().bool() {
|
||||
verify_result := os.execute('v fmt -verify ${vfiles.join(' ')}')
|
||||
if verify_result.exit_code != 0 {
|
||||
eprintln(verify_result.output)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue