Skip to content

Commit

Permalink
tools: fix typos (#19546)
Browse files Browse the repository at this point in the history
  • Loading branch information
ttytm authored Oct 11, 2023
1 parent 491b5f7 commit 2332c17
Show file tree
Hide file tree
Showing 14 changed files with 38 additions and 38 deletions.
4 changes: 2 additions & 2 deletions cmd/tools/gen_vc.v
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ fn (mut gen_vc GenVC) generate() {
if !os.is_dir(gen_vc.options.work_dir) {
// try create
os.mkdir(gen_vc.options.work_dir) or { panic(err) }
// still dosen't exist... we have a problem
// still doesn't exist... we have a problem
if !os.is_dir(gen_vc.options.work_dir) {
gen_vc.logger.error('error creating directory: ${gen_vc.options.work_dir}')
gen_vc.gen_error = true
Expand All @@ -219,7 +219,7 @@ fn (mut gen_vc GenVC) generate() {
// if we are not running with the --serve flag (webhook server)
// rather than deleting and re-downloading the repo each time
// first check to see if the local v repo is behind master
// if it isn't behind theres no point continuing further
// if it isn't behind there's no point continuing further
if !gen_vc.options.serve && os.is_dir(git_repo_dir_v) {
gen_vc.cmd_exec('git -C ${git_repo_dir_v} checkout master')
// fetch the remote repo just in case there are newer commits there
Expand Down
14 changes: 7 additions & 7 deletions cmd/tools/git_pre_commit_hook.vsh
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -15,16 +15,16 @@ 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.
// That can be used to commit some .v files that are not formatted, without removing
// 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')
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion cmd/tools/modules/testing/common.v
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ pub fn setup_new_vtmp_folder() string {
pub struct TestDetails {
pub mut:
retry int
flaky bool // when flaky tests fail, the whole run is still considered successfull, unless VTEST_FAIL_FLAKY is 1
flaky bool // when flaky tests fail, the whole run is still considered successful, unless VTEST_FAIL_FLAKY is 1
}

pub fn get_test_details(file string) TestDetails {
Expand Down
6 changes: 3 additions & 3 deletions cmd/tools/repeat.v
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,9 @@ fn (mut context Context) run() {
eprintln('${i:10} non 0 exit code for cmd: ${cmd}')
continue
}
trimed_output := res.output.trim_right('\r\n')
trimed_normalized := trimed_output.replace('\r\n', '\n')
lines := trimed_normalized.split('\n')
trimmed_output := res.output.trim_right('\r\n')
trimmed_normalized := trimmed_output.replace('\r\n', '\n')
lines := trimmed_normalized.split('\n')
for line in lines {
context.results[icmd].outputs << line
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/tools/vast/test/demo.v
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ interface Myinterfacer {
sub(int, int) int
}

// main funciton
// main function
fn main() {
add(1, 3)
println(add(1, 2))
Expand Down
2 changes: 1 addition & 1 deletion cmd/tools/vbug.v
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ fn get_vdoctor_output(is_verbose bool) string {
return result.output
}

// get ouput from `v -g -o vdbg cmd/v && vdbg file.v`
// get output from `v -g -o vdbg cmd/v && vdbg file.v`
fn get_v_build_output(is_verbose bool, is_yes bool, file_path string) string {
mut vexe := os.getenv('VEXE')
// prepare a V compiler with -g to have better backtraces if possible
Expand Down
14 changes: 7 additions & 7 deletions cmd/tools/vcheck-md.v
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ fn (mut f MDFile) parse_line(lnumber int, line string) {

struct Headline {
line int
lable string
label string
level int
}

Expand All @@ -277,7 +277,7 @@ type AnchorTarget = Anchor | Headline

struct AnchorLink {
line int
lable string
label string
}

struct AnchorData {
Expand All @@ -287,7 +287,7 @@ mut:
}

fn (mut ad AnchorData) add_links(line_number int, line string) {
query := r'\[(?P<lable>[^\]]+)\]\(\s*#(?P<link>[a-z0-9\-\_\x7f-\uffff]+)\)'
query := r'\[(?P<label>[^\]]+)\]\(\s*#(?P<link>[a-z0-9\-\_\x7f-\uffff]+)\)'
mut re := regex.regex_opt(query) or { panic(err) }
res := re.find_all_str(line)

Expand All @@ -296,7 +296,7 @@ fn (mut ad AnchorData) add_links(line_number int, line string) {
link := re.get_group_by_name(elem, 'link')
ad.links[link] << AnchorLink{
line: line_number
lable: re.get_group_by_name(elem, 'lable')
label: re.get_group_by_name(elem, 'label')
}
}
}
Expand All @@ -308,7 +308,7 @@ fn (mut ad AnchorData) add_link_targets(line_number int, line string) {
link := create_ref_link(headline)
ad.anchors[link] << Headline{
line: line_number
lable: headline
label: headline
level: headline_start_pos
}
}
Expand Down Expand Up @@ -344,7 +344,7 @@ fn (mut ad AnchorData) check_link_target_match(fpath string, mut res CheckResult
found_error_warning = true
res.errors++
for brokenlink in linkdata {
eprintln(eline(fpath, brokenlink.line, 0, 'no link target found for existing link [${brokenlink.lable}](#${link})'))
eprintln(eline(fpath, brokenlink.line, 0, 'no link target found for existing link [${brokenlink.label}](#${link})'))
}
}
}
Expand Down Expand Up @@ -651,7 +651,7 @@ fn (mut f MDFile) report_not_formatted_example_if_needed(e VCodeExample, fmt_res
}
f.autofix_example(e, vfile) or {
if err is ExampleWasRewritten {
eprintln('>> f.path: ${f.path} | example from ${e.sline} to ${e.eline} was re-formated by vfmt')
eprintln('>> f.path: ${f.path} | example from ${e.sline} to ${e.eline} was re-formatted by vfmt')
return err
}
eprintln('>> f.path: ${f.path} | encountered error while autofixing the example: ${err}')
Expand Down
16 changes: 8 additions & 8 deletions cmd/tools/vgret.defaults.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

# Reasons for ex- or inclusion:
#
# 'examples/snek/snek.v' // Inacurrate captures
# 'examples/snek/snek.v' // Inaccurate captures
# 'examples/game_of_life/life_gg.v' // OK
# 'examples/tetris/tetris.v' // Uses random start block
# 'examples/fireworks/fireworks.v' // Uses rand for placement
Expand All @@ -63,12 +63,12 @@
# 'examples/2048/2048.v' // Random start tiles
# 'examples/clock/clock.v' // Can only be tested on exact points in time :)
# 'examples/flappylearning/game.v' // Random movement
# 'examples/hot_reload/bounce.v' // Inacurrate captures
# 'examples/hot_reload/graph.v' // Inacurrate captures
# 'examples/hot_reload/bounce.v' // Inaccurate captures
# 'examples/hot_reload/graph.v' // Inaccurate captures
# 'examples/ttf_font/example_ttf.v', // OK
# 'examples/sokol/01_cubes/cube.v', // Can pass with a warning and diff at around 1.2%
# 'examples/sokol/02_cubes_glsl/cube_glsl.v', // Inacurrate captures
# 'examples/sokol/03_march_tracing_glsl/rt_glsl.v', // Inacurrate captures
# 'examples/sokol/04_multi_shader_glsl/rt_glsl.v', // Inacurrate captures
# 'examples/sokol/05_instancing_glsl/rt_glsl.v', // Inacurrate captures
# 'examples/sokol/06_obj_viewer/show_obj.v', // Inacurrate captures
# 'examples/sokol/02_cubes_glsl/cube_glsl.v', // Inaccurate captures
# 'examples/sokol/03_march_tracing_glsl/rt_glsl.v', // Inaccurate captures
# 'examples/sokol/04_multi_shader_glsl/rt_glsl.v', // Inaccurate captures
# 'examples/sokol/05_instancing_glsl/rt_glsl.v', // Inaccurate captures
# 'examples/sokol/06_obj_viewer/show_obj.v', // Inaccurate captures
2 changes: 1 addition & 1 deletion cmd/tools/vpm.v
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ fn vpm_install_from_vcs(module_names []string, vcs_key string) {
if final_module_path != minfo.final_module_path {
println('Relocating module from "${name}" to "${vmod_.name}" ( "${minfo.final_module_path}" ) ...')
if os.exists(minfo.final_module_path) {
eprintln('Warning module "${minfo.final_module_path}" already exsits!')
eprintln('Warning module "${minfo.final_module_path}" already exists!')
eprintln('Removing module "${minfo.final_module_path}" ...')
os.rmdir_all(minfo.final_module_path) or {
errors++
Expand Down
2 changes: 1 addition & 1 deletion cmd/tools/vshader.v
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ fn compile_shaders(opt Options, input_path string) ! {
// compile_shader compiles `shader_file` to a C header file.
fn compile_shader(opt CompileOptions, shader_file string) ! {
path := opt.invoke_path
// The output convetion, for now, is to use the name of the .glsl file
// The output convention, for now, is to use the name of the .glsl file
mut out_file := os.file_name(shader_file).all_before_last('.') + '.h'
out_file = os.join_path(path, out_file)

Expand Down
2 changes: 1 addition & 1 deletion cmd/tools/vtest-all.v
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ fn get_all_commands() []Command {
line: '${vexe} run examples/v_script.vsh > /dev/null'
okmsg: 'V can run the .VSH script file examples/v_script.vsh'
}
// Note: -experimental is used here, just to suppress the warningss,
// Note: -experimental is used here, just to suppress the warnings,
// that are otherwise printed by the native backend,
// until globals and hash statements *are implemented*:
$if linux {
Expand Down
2 changes: 1 addition & 1 deletion cmd/tools/vvet/tests/no_warn_about_missing.vv
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

// read_response is a carefully constructed comment.
// read_response_body. <-- this would earlier trigger a false
// postive.
// positive.
pub fn read_response() ?(string, string) {}
6 changes: 3 additions & 3 deletions cmd/tools/vwhere/finder.v
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ fn (mut fdr Finder) configure_from_arguments(args []string) {
}
fdr.visib.set_from_str(cmdline.option(args, '-vis', '${Visibility.all}'))
if fdr.symbol == .var && fdr.visib != .all {
make_and_print_error('-vis ${fdr.visib} just can be setted with symbol_type:',
make_and_print_error('-vis ${fdr.visib} just can be set with symbol_type:',
['fn', 'method', 'const', 'struct', 'enum', 'interface', 'regexp'],
'${fdr.symbol}')
}
fdr.mutab.set_from_str(cmdline.option(args, '-mut', '${Mutability.any}'))
if fdr.symbol != .var && fdr.mutab != .any {
make_and_print_error('-mut ${fdr.mutab} just can be setted with symbol_type:',
make_and_print_error('-mut ${fdr.mutab} just can be set with symbol_type:',
['var'], '${fdr.symbol}')
}
fdr.modul = cmdline.option(args, '-mod', '')
Expand Down Expand Up @@ -89,7 +89,7 @@ fn (mut fdr Finder) search_for_matches() {
// println(f)
// }

// Auxiliar rgx
// Auxiliary rgx
sp := r'\s*'
op := r'\('
cp := r'\)'
Expand Down
2 changes: 1 addition & 1 deletion cmd/tools/vwhere/test/file_two.v
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub enum Public {

enum Private {
storable
donwloadable
downloadable
}

interface Drinker {
Expand Down

0 comments on commit 2332c17

Please sign in to comment.