all: change empty comment to newline (#22053)

This commit is contained in:
yuyi 2024-08-16 17:09:30 +08:00 committed by GitHub
parent 38e23a76f3
commit cb58db56ef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
20 changed files with 31 additions and 33 deletions

View File

@ -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

View File

@ -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}"')

View File

@ -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'

View File

@ -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()

View File

@ -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)

View File

@ -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)

View File

@ -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.')

View File

@ -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')
@ -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')
}

View File

@ -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 {

View File

@ -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('\\', '/')
@ -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 {

View File

@ -169,7 +169,7 @@ mut:
examples []VCodeExample
current VCodeExample
state MDFileParserState = .markdown
//
oks int
warnings int
errors int // compilation errors + formatting errors

View File

@ -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'
@ -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' {
@ -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')
}

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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
@ -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}')

View File

@ -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 {
@ -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 {

View File

@ -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 {
@ -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 {
@ -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)

View File

@ -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)!

View File

@ -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>