Skip to content

Commit

Permalink
all: change empty comment to newline
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyi98 committed Aug 16, 2024
1 parent 384b5c4 commit 78b43bc
Show file tree
Hide file tree
Showing 20 changed files with 31 additions and 33 deletions.
2 changes: 1 addition & 1 deletion cmd/tools/bench/wyhash.v
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fn main() {
}
bgenerating.measure('generating strings')
println('Hashing each of the generated strings...')
//

mut bhashing_1 := benchmark.start()
start_pos = 0
checksum = 0
Expand Down
4 changes: 1 addition & 3 deletions cmd/tools/changelog_helper.v
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,7 @@ fn (mut app App) process_line(text string) ! {
// Always skip docs
delete_processed_line_from_log(text)!
return
}
//
else {
} else {
return
}
println('process_line: cat=${category} "${text}"')
Expand Down
2 changes: 1 addition & 1 deletion cmd/tools/fast/fast.v
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ fn main() {
defer {
elog('fast.html generator end, total: ${total_sw.elapsed().milliseconds():6} ms')
}
//

mut ccompiler_path := 'tcc'
if vdir.contains('/tmp/cirrus-ci-build') {
ccompiler_path = 'clang'
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 @@ -427,7 +427,7 @@ pub fn (mut ts TestSession) test() {
ts.reporter.worker_threads_start(remaining_files, mut ts)
// all the testing happens here:
pool_of_test_runners.work_on_pointers(unsafe { remaining_files.pointers() })
//

ts.benchmark.stop()
ts.append_message(.sentinel, '', MessageThreadContext{ flow_id: '-1' }) // send the sentinel
printing_thread.wait()
Expand Down
4 changes: 2 additions & 2 deletions cmd/tools/modules/testing/output.v
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ mut:
session_stop(message string, mut ts TestSession) // called once per test session, in the main thread, after everything else, suitable for summaries, creating .xml reports, uploads etc.
worker_threads_start(files []string, mut ts TestSession) // called once per test session, in the main thread, right before all the worker threads start
worker_threads_finish(mut ts TestSession) // called once per test session, in the main thread, right after all the worker threads finish
//

report(index int, log_msg LogMessage) // called once per each message, that will be shown (ok/fail/skip etc), only in the reporting thread.
report_stop() // called just once after all messages are processed, only in the reporting thread, but before stop_session.
//

// TODO: reconsider, whether the next methods, should be kept for all reporters, or just moved inside the normal reporter, to simplify the interface
progress(index int, message string)
update_last_line(index int, message string)
Expand Down
4 changes: 2 additions & 2 deletions cmd/tools/oldv.v
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ fn sync_cache() {

fn main() {
scripting.used_tools_must_exist(['git'])
//

// Resetting VEXE here allows for `v run cmd/tools/oldv.v'.
// the parent V would have set VEXE, which later will
// affect the V's run from the tool itself.
os.setenv('VEXE', '', true)
//

mut context := Context{}
context.vgo.workdir = cache_oldv_folder
mut fp := flag.new_flag_parser(os.args)
Expand Down
2 changes: 1 addition & 1 deletion cmd/tools/regress.v
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ fn main() {
To find when a feature was implemented (feature.v should succeed on master):
./v run cmd/tools/regress.v --old a7019ac --command "! ./v run /abs/path/to/feature.v"')
fp.skip_executable()
//

context.new_commit = fp.string('new', `n`, 'master', 'The new commit, by default: master.')
context.old_commit = fp.string('old', `o`, '', 'A known old commit, required (for it, COMMAND should exit with 0).')
context.command = fp.string('command', `c`, '', 'A command to execute. Should exit with 0 for the *old* commits.')
Expand Down
4 changes: 2 additions & 2 deletions cmd/tools/test_if_v_test_system_works.v
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ fn main() {
check_ok('${vexe} test ${ok_fpath}').matches('*OK*a_single_ok_test.v*')
check_ok('${vexe} test "${tdir}"').matches('*OK*a_single_ok_test.v*')
check_ok('${vexe} -stats test "${tdir}"').matches('*OK*a_single_ok_test.v*')
//

fail_fpath := create_test('a_single_failing_test.v', 'fn test_fail(){ assert 1 == 2 }')!
check_fail('${vexe} ${fail_fpath}').has('> assert 1 == 2').has('a_single_failing_test.v:1: fn test_fail')
check_fail('${vexe} test ${fail_fpath}').has('> assert 1 == 2').has('a_single_failing_test.v:1: fn test_fail')
Expand All @@ -129,7 +129,7 @@ fn main() {
os.chdir(rel_dir)!
relative_path := '..' + os.path_separator + 'a_single_ok_test.v'
check_ok('${vexe} test ${os.quoted_path(relative_path)}').has('OK').has('a_single_ok_test.v')
//

check_assert_continues_works()!
println('> all done')
}
2 changes: 1 addition & 1 deletion cmd/tools/vbug.v
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ fn get_v_build_output(is_verbose bool, is_yes bool, file_path string) string {
} else {
eprintln('unable to compile V in debug mode: ${vdbg_result.output}\ncommand: ${vdbg_compilation_cmd}\n')
}
//

mut result := os.execute('${os.quoted_path(vexe)} ${verbose_flag} ${os.quoted_path(file_path)}')
defer {
os.rm(vdbg_path) or {
Expand Down
4 changes: 2 additions & 2 deletions cmd/tools/vbuild-tools.v
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fn main() {
tfolder := os.join_path(vroot, 'cmd', 'tools')
main_label := 'Building ${folder} ...'
finish_label := 'building ${folder}'
//

mut skips := []string{}
for stool in tools_in_subfolders {
skips << os.join_path(tfolder, stool).replace('\\', '/')
Expand All @@ -49,7 +49,7 @@ fn main() {
if session.failed_cmds.len > 0 {
exit(1)
}
//

mut executables := os.ls(session.vtmp_dir)!
executables.sort()
for texe in executables {
Expand Down
2 changes: 1 addition & 1 deletion cmd/tools/vcheck-md.v
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ mut:
examples []VCodeExample
current VCodeExample
state MDFileParserState = .markdown
//

oks int
warnings int
errors int // compilation errors + formatting errors
Expand Down
6 changes: 3 additions & 3 deletions cmd/tools/vdoctor.v
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ fn (mut a App) println(s string) {

fn (mut a App) collect_info() {
a.line('V full version', version.full_v_version(true))
//

mut os_kind := os.user_os()
mut arch_details := []string{}
arch_details << '${runtime.nr_cpus()} cpus'
Expand Down Expand Up @@ -54,7 +54,7 @@ fn (mut a App) collect_info() {
line: 1
)
}
//

mut os_details := ''
wsl_check := a.cmd(command: 'cat /proc/sys/kernel/osrelease')
if os_kind == 'linux' {
Expand Down Expand Up @@ -122,7 +122,7 @@ fn (mut a App) collect_info() {
a.line('Git vroot status', a.git_info())
a.line('.git/config present', os.is_file('.git/config').str())
a.println('')
//

a.line('CC version', a.cmd(command: 'cc --version'))
a.report_tcc_version('thirdparty/tcc')
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/tools/vrepeat.v
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ fn new_aints(ovals []i64, extreme_mins int, extreme_maxs int) Aints {
if vals.len > 0 {
res.average = sum / f64(vals.len)
}
//

mut devsum := f64(0.0)
for i in vals {
x := f64(i) - res.average
Expand Down
2 changes: 1 addition & 1 deletion cmd/tools/vrepl.v
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ mut:
is_pin bool // does the repl 'pin' entered source code
folder string // the folder in which the repl will write its temporary source files
last_output string // the last repl output
//

modules []string // all the import modules
alias map[string]string // all the alias used in the import
includes []string // all the #include statements
Expand Down
2 changes: 1 addition & 1 deletion cmd/tools/vself.v
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fn main() {
}
vexe_name := os.file_name(vexe)
short_v_name := vexe_name.all_before('.')
//

recompilation.must_be_enabled(vroot, 'Please install V from source, to use `${vexe_name} self` .')
os.chdir(vroot)!
os.setenv('VCOLORS', 'always', true)
Expand Down
6 changes: 3 additions & 3 deletions cmd/tools/vtest-all.v
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ fn (mut cmd Command) run() {
return
}
}
//

mut is_failed := false
mut is_failed_expected := false
mut is_failed_starts_with := false
Expand Down Expand Up @@ -497,10 +497,10 @@ fn (mut cmd Command) run() {
is_failed_contains = true
}
}
//

run_label := if is_failed { term.failed('FAILED') } else { term_highlight('OK') }
println('> Running: "${cmd.line}" took: ${spent} ms ... ${run_label}')
//

if is_failed && is_failed_expected {
eprintln('> expected:\n${cmd.expect}')
eprintln('> output:\n${cmd.output}')
Expand Down
4 changes: 2 additions & 2 deletions cmd/tools/vtest-cleancode.v
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ fn v_test_vetting(vargs string) ! {
}
vet_session := tsession(vargs, 'vvet', '${os.quoted_path(vexe)} vet', 'vet', expanded_vet_list,
vet_known_exceptions)
//

fmt_cmd, fmt_args := if is_fix {
'${os.quoted_path(vexe)} fmt -w', 'fmt -w'
} else {
Expand All @@ -88,7 +88,7 @@ fn v_test_vetting(vargs string) ! {
vfmt_list := util.find_all_v_files(vfmt_verify_list) or { return }
exceptions := util.find_all_v_files(vfmt_known_failing_exceptions) or { return }
verify_session := tsession(vargs, 'vfmt.v', fmt_cmd, fmt_args, vfmt_list, exceptions)
//

if vet_session.benchmark.nfail > 0 || verify_session.benchmark.nfail > 0 {
eprintln('\n')
if vet_session.benchmark.nfail > 0 {
Expand Down
6 changes: 3 additions & 3 deletions doc/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -3723,7 +3723,7 @@ struct Dog {}
fn main() {
cat := Cat{}
assert dump(cat.speak()) == 'meow!'
//
a := Adoptable(cat)
assert dump(a.speak()) == 'adopt me!' // call Adoptable's `speak`
if a is Cat {
Expand All @@ -3732,7 +3732,7 @@ fn main() {
// Cat `speak`, NOT the Adoptable `speak`:
dump(a.speak()) // meow!
}
//
b := Adoptable(Dog{})
assert dump(b.speak()) == 'adopt me!' // call Adoptable's `speak`
// if b is Dog {
Expand Down Expand Up @@ -7328,7 +7328,7 @@ fn main() {
nr_users := C.sqlite3_column_int(stmt, 0)
C.sqlite3_finalize(stmt)
println('There are ${nr_users} users in the database.')
//
error_msg := &char(0)
query_all_users := 'select * from users'
rc := C.sqlite3_exec(db, &char(query_all_users.str), my_callback, voidptr(7), &error_msg)
Expand Down
2 changes: 1 addition & 1 deletion vlib/x/crypto/chacha20poly1305/chacha20poly1305_test.v
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ fn test_aead_decrypt_vector_test_51() ! {
mut ciphertext_msg := []u8{}
ciphertext_msg << ciphertext
ciphertext_msg << expected_tag
//

ncsize := nonce.len
mut c := new(key, ncsize)!
mut cs := chacha20.new_cipher(key, nonce)!
Expand Down
2 changes: 1 addition & 1 deletion vlib/x/templating/dtm/tmpl.v
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ enum State {
simple // default - no special interpretation of tags, *at all*!
// That is suitable for the general case of text template interpolation,
// for example for interpolating arbitrary source code (even V source) templates.
//

html // default, only when the template extension is .html
css // <style>
js // <script>
Expand Down

0 comments on commit 78b43bc

Please sign in to comment.