vet: accumulate the collected errors manually (fixes CI)

pull/6298/head
Delyan Angelov 2020-10-06 10:02:35 +03:00
parent 70826914a7
commit 8e5067421f
3 changed files with 2 additions and 5 deletions

View File

@ -70,6 +70,6 @@ fn (mut vet_options VetOptions) vet_file(path string) {
table := table.new_table()
vet_options.vprintln("vetting file '$path'...")
file_ast, errors := parser.parse_vet_file(path, table, prefs)
vet_options.errors = errors
vet_options.errors << errors
vet.vet(file_ast, table, true)
}

View File

@ -149,6 +149,7 @@ pub fn parse_vet_file(path string, table_ &table.Table, pref &pref.Preferences)
}
}
file := p.parse()
p.vet_errors << p.scanner.vet_errors
return file, p.vet_errors
}

View File

@ -1394,10 +1394,6 @@ pub fn (s &Scanner) error(msg string) {
fn (mut s Scanner) vet_error(msg string) {
eline := '$s.file_path:$s.line_nr: $msg'
if s.vet_errors.len == 0 {
eprintln(eline)
return
}
s.vet_errors << eline
}