tools: add a vet_known_failing_windows skip list to `v test-cleancode`
parent
68569ae598
commit
c78022c583
|
@ -5,9 +5,22 @@ import testing
|
||||||
import v.util
|
import v.util
|
||||||
import arrays
|
import arrays
|
||||||
|
|
||||||
const (
|
const vet_known_failing = [
|
||||||
vet_known_failing_exceptions = []string{}
|
'do_not_delete_this',
|
||||||
vet_folders = [
|
]
|
||||||
|
|
||||||
|
const vet_known_failing_windows = [
|
||||||
|
'do_not_delete_this',
|
||||||
|
'vlib/v/gen/js/tests/testdata/byte_is_space.v',
|
||||||
|
'vlib/v/gen/js/tests/testdata/compare_ints.v',
|
||||||
|
'vlib/v/gen/js/tests/testdata/hw.v',
|
||||||
|
'vlib/v/gen/js/tests/testdata/string_methods.v',
|
||||||
|
'vlib/v/tests/project_with_modules_having_submodules/bin/main.vsh',
|
||||||
|
'vlib/v/tests/valgrind/simple_interpolation_script_mode.v',
|
||||||
|
'vlib/v/tests/valgrind/simple_interpolation_script_mode_more_scopes.v',
|
||||||
|
]
|
||||||
|
|
||||||
|
const vet_folders = [
|
||||||
'vlib/sqlite',
|
'vlib/sqlite',
|
||||||
'vlib/v',
|
'vlib/v',
|
||||||
'vlib/x/json2',
|
'vlib/x/json2',
|
||||||
|
@ -18,7 +31,8 @@ const (
|
||||||
'examples/tetris',
|
'examples/tetris',
|
||||||
'examples/term.ui',
|
'examples/term.ui',
|
||||||
]
|
]
|
||||||
verify_known_failing_exceptions = [
|
|
||||||
|
const verify_known_failing_exceptions = [
|
||||||
// Handcrafted meaningful formatting of code parts (mostly arrays)
|
// Handcrafted meaningful formatting of code parts (mostly arrays)
|
||||||
'examples/sokol/02_cubes_glsl/cube_glsl.v',
|
'examples/sokol/02_cubes_glsl/cube_glsl.v',
|
||||||
'examples/sokol/03_march_tracing_glsl/rt_glsl.v',
|
'examples/sokol/03_march_tracing_glsl/rt_glsl.v',
|
||||||
|
@ -33,24 +47,25 @@ const (
|
||||||
// TODOs and unfixed vfmt bugs
|
// TODOs and unfixed vfmt bugs
|
||||||
'vlib/v/gen/js/tests/js.v', /* local `hello` fn, gets replaced with module `hello` aliased as `hl` */
|
'vlib/v/gen/js/tests/js.v', /* local `hello` fn, gets replaced with module `hello` aliased as `hl` */
|
||||||
]
|
]
|
||||||
vfmt_verify_list = [
|
|
||||||
|
const vfmt_verify_list = [
|
||||||
'cmd/',
|
'cmd/',
|
||||||
'examples/',
|
'examples/',
|
||||||
'tutorials/',
|
'tutorials/',
|
||||||
'vlib/',
|
'vlib/',
|
||||||
]
|
]
|
||||||
vfmt_known_failing_exceptions = arrays.merge(verify_known_failing_exceptions, [
|
|
||||||
|
const vfmt_known_failing_exceptions = arrays.merge(verify_known_failing_exceptions, [
|
||||||
'vlib/regex/regex_test.v' /* contains meaningfull formatting of the test case data */,
|
'vlib/regex/regex_test.v' /* contains meaningfull formatting of the test case data */,
|
||||||
'vlib/crypto/sha512/sha512block_generic.v' /* formatting of large constant arrays wraps to too many lines */,
|
'vlib/crypto/sha512/sha512block_generic.v' /* formatting of large constant arrays wraps to too many lines */,
|
||||||
'vlib/crypto/aes/const.v' /* formatting of large constant arrays wraps to too many lines */,
|
'vlib/crypto/aes/const.v' /* formatting of large constant arrays wraps to too many lines */,
|
||||||
])
|
])
|
||||||
)
|
|
||||||
|
|
||||||
const (
|
const vexe = os.getenv('VEXE')
|
||||||
vexe = os.getenv('VEXE')
|
|
||||||
vroot = os.dir(vexe)
|
const vroot = os.dir(vexe)
|
||||||
is_fix = '-fix' in os.args
|
|
||||||
)
|
const is_fix = '-fix' in os.args
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
args_string := os.args[1..].join(' ')
|
args_string := os.args[1..].join(' ')
|
||||||
|
@ -76,8 +91,12 @@ fn tsession(vargs string, tool_source string, tool_cmd string, tool_args string,
|
||||||
|
|
||||||
fn v_test_vetting(vargs string) {
|
fn v_test_vetting(vargs string) {
|
||||||
expanded_vet_list := util.find_all_v_files(vet_folders) or { return }
|
expanded_vet_list := util.find_all_v_files(vet_folders) or { return }
|
||||||
|
mut vet_known_exceptions := vet_known_failing.clone()
|
||||||
|
if os.user_os() == 'windows' {
|
||||||
|
vet_known_exceptions << vet_known_failing_windows
|
||||||
|
}
|
||||||
vet_session := tsession(vargs, 'vvet', '${os.quoted_path(vexe)} vet', 'vet', expanded_vet_list,
|
vet_session := tsession(vargs, 'vvet', '${os.quoted_path(vexe)} vet', 'vet', expanded_vet_list,
|
||||||
vet_known_failing_exceptions)
|
vet_known_exceptions)
|
||||||
//
|
//
|
||||||
fmt_cmd, fmt_args := if is_fix {
|
fmt_cmd, fmt_args := if is_fix {
|
||||||
'${os.quoted_path(vexe)} fmt -w', 'fmt -w'
|
'${os.quoted_path(vexe)} fmt -w', 'fmt -w'
|
||||||
|
|
Loading…
Reference in New Issue