diff --git a/cmd/tools/gen_vc.v b/cmd/tools/gen_vc.v index a0ea67e81b..386d364db1 100644 --- a/cmd/tools/gen_vc.v +++ b/cmd/tools/gen_vc.v @@ -133,7 +133,7 @@ fn new_gen_vc(flag_options FlagOptions) &GenVC { } return &GenVC{ options: flag_options - logger: logger + logger: logger } } @@ -171,14 +171,14 @@ pub fn (ws &WebhookServer) reset() { // parse flags to FlagOptions struct fn parse_flags(mut fp flag.FlagParser) FlagOptions { return FlagOptions{ - serve: fp.bool('serve', 0, false, 'run in webhook server mode') + serve: fp.bool('serve', 0, false, 'run in webhook server mode') work_dir: fp.string('work-dir', 0, work_dir, 'gen_vc working directory') - purge: fp.bool('purge', 0, false, 'force purge the local repositories') - port: fp.int('port', 0, server_port, 'port for web server to listen on') - log_to: fp.string('log-to', 0, log_to, "log to is 'file' or 'terminal'") + purge: fp.bool('purge', 0, false, 'force purge the local repositories') + port: fp.int('port', 0, server_port, 'port for web server to listen on') + log_to: fp.string('log-to', 0, log_to, "log to is 'file' or 'terminal'") log_file: fp.string('log-file', 0, log_file, "log file to use when log-to is 'file'") - dry_run: fp.bool('dry-run', 0, dry_run, 'when specified dont push anything to remote repo') - force: fp.bool('force', 0, false, 'force update even if already up to date') + dry_run: fp.bool('dry-run', 0, dry_run, 'when specified dont push anything to remote repo') + force: fp.bool('force', 0, false, 'force update even if already up to date') } } diff --git a/cmd/tools/measure/fmt_speed.v b/cmd/tools/measure/fmt_speed.v index c14cd8d9ba..a213854c9b 100644 --- a/cmd/tools/measure/fmt_speed.v +++ b/cmd/tools/measure/fmt_speed.v @@ -84,13 +84,13 @@ fn process_files(files []string) ! { fn new_parser(path string, comments_mode scanner.CommentsMode, table &ast.Table, pref_ &pref.Preferences) &parser.Parser { mut p := &parser.Parser{ scanner: scanner.new_scanner_file(path, comments_mode, pref_) or { panic(err) } - table: table - pref: pref_ - scope: &ast.Scope{ + table: table + pref: pref_ + scope: &ast.Scope{ start_pos: 0 - parent: table.global_scope + parent: table.global_scope } - errors: []errors.Error{} + errors: []errors.Error{} warnings: []errors.Warning{} } p.set_path(path) diff --git a/cmd/tools/measure/parser_speed.v b/cmd/tools/measure/parser_speed.v index b6c75135d6..79afde28a1 100644 --- a/cmd/tools/measure/parser_speed.v +++ b/cmd/tools/measure/parser_speed.v @@ -79,13 +79,13 @@ fn process_files(files []string) ! { fn new_parser(path string, comments_mode scanner.CommentsMode, table &ast.Table, pref_ &pref.Preferences) &parser.Parser { mut p := &parser.Parser{ scanner: scanner.new_scanner_file(path, comments_mode, pref_) or { panic(err) } - table: table - pref: pref_ - scope: &ast.Scope{ + table: table + pref: pref_ + scope: &ast.Scope{ start_pos: 0 - parent: table.global_scope + parent: table.global_scope } - errors: []errors.Error{} + errors: []errors.Error{} warnings: []errors.Warning{} } p.set_path(path) diff --git a/cmd/tools/modules/testing/common.v b/cmd/tools/modules/testing/common.v index 74c19d1f07..c5aa9064c1 100644 --- a/cmd/tools/modules/testing/common.v +++ b/cmd/tools/modules/testing/common.v @@ -117,22 +117,22 @@ mut: fn (mut ts TestSession) append_message(kind MessageKind, msg string, mtc MessageThreadContext) { ts.nmessages <- LogMessage{ - file: mtc.file + file: mtc.file flow_id: mtc.flow_id message: msg - kind: kind - when: time.now() + kind: kind + when: time.now() } } fn (mut ts TestSession) append_message_with_duration(kind MessageKind, msg string, d time.Duration, mtc MessageThreadContext) { ts.nmessages <- LogMessage{ - file: mtc.file + file: mtc.file flow_id: mtc.flow_id message: msg - kind: kind - when: time.now() - took: d + kind: kind + when: time.now() + took: d } } @@ -310,16 +310,16 @@ pub fn new_test_session(_vargs string, will_compile bool) TestSession { os.setenv('VCOLORS', 'always', true) } mut ts := TestSession{ - vexe: vexe - vroot: vroot - skip_files: skip_files - fail_fast: testing.fail_fast - show_stats: '-stats' in vargs.split(' ') - show_asserts: '-show-asserts' in vargs.split(' ') - vargs: vargs - vtmp_dir: new_vtmp_dir - hash: hash - silent_mode: _vargs.contains('-silent') + vexe: vexe + vroot: vroot + skip_files: skip_files + fail_fast: testing.fail_fast + show_stats: '-stats' in vargs.split(' ') + show_asserts: '-show-asserts' in vargs.split(' ') + vargs: vargs + vtmp_dir: new_vtmp_dir + hash: hash + silent_mode: _vargs.contains('-silent') progress_mode: _vargs.contains('-progress') } ts.handle_test_runner_option() @@ -493,7 +493,7 @@ fn worker_trunner(mut p pool.PoolProcessor, idx int, thread_id int) voidptr { } file := os.real_path(relative_file) mtc := MessageThreadContext{ - file: file + file: file flow_id: thread_id.str() } normalised_relative_file := relative_file.replace('\\', '/') diff --git a/cmd/tools/oldv.v b/cmd/tools/oldv.v index bcf9900b95..822888a70f 100644 --- a/cmd/tools/oldv.v +++ b/cmd/tools/oldv.v @@ -44,15 +44,15 @@ mut: fn (mut c Context) compile_oldv_if_needed() { c.vgcontext = vgit.VGitContext{ - workdir: c.vgo.workdir - v_repo_url: c.vgo.v_repo_url - vc_repo_url: c.vgo.vc_repo_url - cc: c.cc - commit_v: c.commit_v - path_v: c.path_v - path_vc: c.path_vc + workdir: c.vgo.workdir + v_repo_url: c.vgo.v_repo_url + vc_repo_url: c.vgo.vc_repo_url + cc: c.cc + commit_v: c.commit_v + path_v: c.path_v + path_vc: c.path_vc make_fresh_tcc: c.fresh_tcc - show_vccommit: c.show_vccommit + show_vccommit: c.show_vccommit } c.vgcontext.compile_oldv_if_needed() c.commit_v_hash = c.vgcontext.commit_v__hash diff --git a/cmd/tools/performance_compare.v b/cmd/tools/performance_compare.v index e59758d35f..56304441c0 100644 --- a/cmd/tools/performance_compare.v +++ b/cmd/tools/performance_compare.v @@ -25,9 +25,9 @@ mut: fn new_context() Context { return Context{ - cwd: os.getwd() + cwd: os.getwd() commit_after: 'master' - warmups: 4 + warmups: 4 } } @@ -80,12 +80,12 @@ fn (c &Context) prepare_v(cdir string, commit string) { cc = 'cc' } mut vgit_context := vgit.VGitContext{ - cc: cc - commit_v: commit - path_v: cdir - path_vc: c.vc - workdir: c.vgo.workdir - v_repo_url: c.vgo.v_repo_url + cc: cc + commit_v: commit + path_v: cdir + path_vc: c.vc + workdir: c.vgo.workdir + v_repo_url: c.vgo.v_repo_url vc_repo_url: c.vgo.vc_repo_url } vgit_context.compile_oldv_if_needed() diff --git a/cmd/tools/vast/vast.v b/cmd/tools/vast/vast.v index 1380b618d2..a68ace4d9e 100644 --- a/cmd/tools/vast/vast.v +++ b/cmd/tools/vast/vast.v @@ -126,9 +126,9 @@ fn json(file string) string { pref_.is_fmt = true mut t := Tree{ - root: new_object() + root: new_object() table: ast.new_table() - pref: pref_ + pref: pref_ } // parse file with comment ast_file := parser.parse_file(file, mut t.table, .parse_comments, t.pref) diff --git a/cmd/tools/vbump.v b/cmd/tools/vbump.v index 2739d0cf7b..51a1e532de 100644 --- a/cmd/tools/vbump.v +++ b/cmd/tools/vbump.v @@ -144,10 +144,10 @@ Try ${tool_name} -h for more help...') options := Options{ show_help: fp.bool('help', `h`, false, 'Show this help text.') - patch: fp.bool('patch', `p`, false, 'Bump the patch version.') - minor: fp.bool('minor', `n`, false, 'Bump the minor version.') - major: fp.bool('major', `m`, false, 'Bump the major version.') - skip: fp.string('skip', `s`, '', 'Skip lines matching this substring.').trim_space() + patch: fp.bool('patch', `p`, false, 'Bump the patch version.') + minor: fp.bool('minor', `n`, false, 'Bump the minor version.') + major: fp.bool('major', `m`, false, 'Bump the major version.') + skip: fp.string('skip', `s`, '', 'Skip lines matching this substring.').trim_space() } remaining := fp.finalize() or { diff --git a/cmd/tools/vbump_test.v b/cmd/tools/vbump_test.v index 8aad9b936a..7ff7c3ce7b 100644 --- a/cmd/tools/vbump_test.v +++ b/cmd/tools/vbump_test.v @@ -23,7 +23,7 @@ struct BumpTestCase { const test_cases = [ BumpTestCase{ file_name: 'v.mod' - contents: "Module { + contents: "Module { name: 'Sample' description: 'Sample project' version: '1.2.6' @@ -32,28 +32,28 @@ const test_cases = [ } " - line: 3 + line: 3 expected_patch: " version: '1.2.7'" expected_minor: " version: '1.3.0'" expected_major: " version: '2.0.0'" }, BumpTestCase{ file_name: 'random_versions.vv' - contents: " + contents: " 1.1.2 1.2.5 3.21.73 version = '1.5.1' " - line: 4 + line: 4 expected_patch: "version = '1.5.2'" expected_minor: "version = '1.6.0'" expected_major: "version = '2.0.0'" }, BumpTestCase{ file_name: 'sample_tool.v' - contents: "// Module comment and copyright information + contents: "// Module comment and copyright information import os import flag @@ -64,7 +64,7 @@ fn main() { // stuff } " - line: 5 + line: 5 expected_patch: "const tool_version = '0.1.34'" expected_minor: "const tool_version = '0.2.0'" expected_major: "const tool_version = '1.0.0'" @@ -111,7 +111,7 @@ struct SkipTestCase { const skip_test_cases = [ SkipTestCase{ file_name: 'CITATION.cff' - contents: 'abstract: A sample CLI tool made in V that prints geometric shapes to the screen. + contents: 'abstract: A sample CLI tool made in V that prints geometric shapes to the screen. authors: - alias: hungrybluedev family-names: Haldar @@ -125,8 +125,8 @@ title: geo url: https://github.com/hungrybluedev/geo version: 0.2.4 ' - line: 12 - skip: 'cff-version' + line: 12 + skip: 'cff-version' expected_patch: 'version: 0.2.5' expected_minor: 'version: 0.3.0' expected_major: 'version: 1.0.0' diff --git a/cmd/tools/vcheck-md.v b/cmd/tools/vcheck-md.v index 96a2ac9d45..6c5cdcd6d7 100644 --- a/cmd/tools/vcheck-md.v +++ b/cmd/tools/vcheck-md.v @@ -34,10 +34,10 @@ pub mut: fn (v1 CheckResult) + (v2 CheckResult) CheckResult { return CheckResult{ - files: v1.files + v2.files + files: v1.files + v2.files warnings: v1.warnings + v2.warnings - errors: v1.errors + v2.errors - oks: v1.oks + v2.oks + errors: v1.errors + v2.errors + oks: v1.oks + v2.oks } } @@ -77,8 +77,8 @@ fn main() { } mut mdfile := MDFile{ skip_line_length_check: skip_line_length_check - path: file_path - lines: lines + path: file_path + lines: lines } res += mdfile.check() } @@ -243,7 +243,7 @@ fn (mut f MDFile) parse_line(lnumber int, line string) { command += ' ${default_command}' } f.current = VCodeExample{ - sline: lnumber + sline: lnumber command: command } } @@ -305,7 +305,7 @@ fn (mut ad AnchorData) add_links(line_number int, line string) { re.match_string(elem) link := re.get_group_by_name(elem, 'link') ad.links[link] << AnchorLink{ - line: line_number + line: line_number label: re.get_group_by_name(elem, 'label') } } @@ -317,7 +317,7 @@ fn (mut ad AnchorData) add_link_targets(line_number int, line string) { headline := line.substr(headline_start_pos + 1, line.len) link := create_ref_link(headline) ad.anchors[link] << Headline{ - line: line_number + line: line_number label: headline level: headline_start_pos } @@ -634,7 +634,7 @@ fn (mut f MDFile) check_examples() CheckResult { } return CheckResult{ errors: errors - oks: oks + oks: oks } } diff --git a/cmd/tools/vcover/main.v b/cmd/tools/vcover/main.v index 96b659a38b..5e8b9e29bd 100644 --- a/cmd/tools/vcover/main.v +++ b/cmd/tools/vcover/main.v @@ -81,9 +81,9 @@ fn (mut ctx Context) process_target(tfile string) ! { for { row := reader.read() or { break } mut cline := CounterLine{ - meta: row[0] + meta: row[0] point: row[1].int() - hits: row[2].u64() + hits: row[2].u64() } m := ctx.meta[cline.meta] or { ctx.verbose('> skipping invalid meta: ${cline.meta} in file: ${cline.file}, csvfile: ${tfile}') diff --git a/cmd/tools/vcreate/project_model_bin.v b/cmd/tools/vcreate/project_model_bin.v index 865fec3312..679dea6fcb 100644 --- a/cmd/tools/vcreate/project_model_bin.v +++ b/cmd/tools/vcreate/project_model_bin.v @@ -5,7 +5,7 @@ import os fn (mut c Create) set_bin_project_files() { base := if c.new_dir { c.name } else { '' } c.files << ProjectFiles{ - path: os.join_path(base, 'src', 'main.v') + path: os.join_path(base, 'src', 'main.v') content: "module main fn main() { diff --git a/cmd/tools/vcreate/project_model_lib.v b/cmd/tools/vcreate/project_model_lib.v index 32dc101a02..3aa1ac5598 100644 --- a/cmd/tools/vcreate/project_model_lib.v +++ b/cmd/tools/vcreate/project_model_lib.v @@ -5,7 +5,7 @@ import os fn (mut c Create) set_lib_project_files() { base := if c.new_dir { c.name } else { '' } c.files << ProjectFiles{ - path: os.join_path(base, 'src', c.name + '.v') + path: os.join_path(base, 'src', c.name + '.v') content: 'module ${c.name} // square calculates the second power of `x` @@ -15,7 +15,7 @@ pub fn square(x int) int { ' } c.files << ProjectFiles{ - path: os.join_path(base, 'tests', 'square_test.v') + path: os.join_path(base, 'tests', 'square_test.v') content: 'import ${c.name} fn test_square() { diff --git a/cmd/tools/vcreate/project_model_web.v b/cmd/tools/vcreate/project_model_web.v index 4758234dc5..e00fd48b04 100644 --- a/cmd/tools/vcreate/project_model_web.v +++ b/cmd/tools/vcreate/project_model_web.v @@ -5,7 +5,7 @@ import os { join_path } fn (mut c Create) set_web_project_files() { base := if c.new_dir { c.name } else { '' } c.files << ProjectFiles{ - path: join_path(base, 'src', 'databases', 'config_databases_sqlite.v') + path: join_path(base, 'src', 'databases', 'config_databases_sqlite.v') content: "module databases import db.sqlite // can change to 'db.mysql', 'db.pg' @@ -17,7 +17,7 @@ pub fn create_db_connection() !sqlite.DB { " } c.files << ProjectFiles{ - path: join_path(base, 'src', 'templates', 'header_component.html') + path: join_path(base, 'src', 'templates', 'header_component.html') content: "