1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

vet: add -W flag and detailed help (#9331)

This commit is contained in:
Lukas Neubert
2021-03-16 18:49:06 +01:00
committed by GitHub
parent 6f550ebbdc
commit 39a9beb9e0
3 changed files with 15 additions and 2 deletions

View File

@ -32,6 +32,8 @@ const vet_options = cmdline.options_after(os.args, ['vet'])
const is_force = '-force' in vet_options
const is_werror = '-W' in vet_options
const is_verbose = '-verbose' in vet_options || '-v' in vet_options
const show_warnings = '-hide-warnings' !in vet_options
@ -104,7 +106,7 @@ fn main() {
if errors_vfmt.len > 0 {
eprintln('NB: You can run `v fmt -w file.v` to fix these automatically')
}
if errors.len > 0 {
if errors.len > 0 || (is_werror && warnings.len > 0) {
exit(1)
}
}