1919local testdata = {}
2020
2121local _l_number_optstring = 2 + debug.getinfo (1 ).currentline
22- function testdata .fn_number_optstring (arg1 , arg2 ) -- luacheck: no unused args
22+ function testdata .fn_number_optstring (_arg1 , _arg2 )
2323 checks (' number' , ' ?string' )
2424end
2525
2626local _l_number_or_string = 2 + debug.getinfo (1 ).currentline
27- function testdata .fn_number_or_string (arg1 ) -- luacheck: no unused args
27+ function testdata .fn_number_or_string (_arg1 )
2828 checks (' number|string' )
2929end
3030
3131local _l_positive_number = 2 + debug.getinfo (1 ).currentline
32- function testdata .fn_positive_number (arg1 ) -- luacheck: no unused args
32+ function testdata .fn_positive_number (_arg1 )
3333 checks (' positive_number' )
3434end
3535
36- function testdata .fn_anytype (arg1 ) -- luacheck: no unused args
36+ function testdata .fn_anytype (_arg1 )
3737 checks (' ?' )
3838end
3939
4040local _l_nil_or_number_or_string = 2 + debug.getinfo (1 ).currentline
41- function testdata .fn_nil_or_number_or_string (arg1 ) -- luacheck: no unused args
41+ function testdata .fn_nil_or_number_or_string (_arg1 )
4242 checks (' nil|number|string' )
4343end
4444
4545local _l_optnumber_or_optstring = 2 + debug.getinfo (1 ).currentline
46- function testdata .fn_optnumber_or_optstring (arg1 ) -- luacheck: no unused args
46+ function testdata .fn_optnumber_or_optstring (_arg1 )
4747 checks (' ?number|?string' )
4848end
4949
5050local _l_varargs = 2 + debug.getinfo (1 ).currentline
51- function testdata .fn_varargs (arg1 , ...) -- luacheck: no unused args
51+ function testdata .fn_varargs (_arg1 , ...) -- luacheck: ignore 212
5252 checks (' string' )
5353end
5454
5555local _l_options = 2 + debug.getinfo (1 ).currentline
56- function testdata .fn_options (options ) -- luacheck: no unused args
56+ function testdata .fn_options (_options )
5757 checks ({
5858 mystring = ' ?string' ,
5959 mynumber = ' ?number' ,
6060 })
6161end
6262
6363local _l_array = 2 + debug.getinfo (1 ).currentline
64- function testdata .fn_array (array ) -- luacheck: no unused args
64+ function testdata .fn_array (_array )
6565 checks ({' number' , ' number' })
6666end
6767
6868local _l_table = 2 + debug.getinfo (1 ).currentline
69- function testdata .fn_table (table ) -- luacheck: no unused args
69+ function testdata .fn_table (_table )
7070 checks ({mykey = ' number' })
7171end
7272
7373local _l_inception = 2 + debug.getinfo (1 ).currentline
74- function testdata .fn_inception (options ) -- luacheck: no unused args
74+ function testdata .fn_inception (_options )
7575 checks ({
7676 we = {
7777 need = {
@@ -90,27 +90,27 @@ local function deepchecks()
9090end
9191
9292local _l_deepcheck = 2 + debug.getinfo (1 ).currentline
93- function testdata .fn_deepcheck (arg1 ) -- luacheck: no unused args
93+ function testdata .fn_deepcheck (_arg1 )
9494 deepchecks ()
9595end
9696
9797local _l_excess_checks = 2 + debug.getinfo (1 ).currentline
98- function testdata .fn_excess_checks (arg1 ) -- luacheck: no unused args
98+ function testdata .fn_excess_checks (_arg1 )
9999 checks (' ?number' , ' ?string' )
100100end
101101
102102local _l_missing_checks = 2 + debug.getinfo (1 ).currentline
103- function testdata .fn_missing_checks (arg1 , arg2 ) -- luacheck: no unused args
103+ function testdata .fn_missing_checks (_arg1 , _arg2 )
104104 checks (' ?number' )
105105end
106106
107107local _l_bad_check_type_1 = 2 + debug.getinfo (1 ).currentline
108- function testdata .bad_check_type_1 (arg1 , arg2 ) -- luacheck: no unused args
108+ function testdata .bad_check_type_1 (_arg1 , _arg2 )
109109 checks (" ?string" , 5 )
110110end
111111
112112local _l_bad_check_type_2 = 2 + debug.getinfo (1 ).currentline
113- function testdata .bad_check_type_2 (arg1 , arg2 ) -- luacheck: no unused args
113+ function testdata .bad_check_type_2 (_arg1 , _arg2 )
114114 checks ({param = 5 })
115115end
116116
@@ -294,12 +294,12 @@ local err_cases = {
294294 {
295295 code = ' fn_options({mynumber = "bad"})' ,
296296 line = _l_options ,
297- error = ' bad argument options .mynumber to fn_options (?number expected, got string)' ,
297+ error = ' bad argument _options .mynumber to fn_options (?number expected, got string)' ,
298298 },
299299 {
300300 code = ' fn_options({badfield = "bad"})' ,
301301 line = _l_options ,
302- error = ' unexpected argument options .badfield to fn_options' ,
302+ error = ' unexpected argument _options .badfield to fn_options' ,
303303 },
304304
305305 -- fn_array
@@ -311,40 +311,40 @@ local err_cases = {
311311 {
312312 code = ' fn_array()' ,
313313 line = _l_array ,
314- error = ' bad argument array [1] to fn_array (number expected, got nil)' ,
314+ error = ' bad argument _array [1] to fn_array (number expected, got nil)' ,
315315 },
316316 {
317317 code = ' fn_array(nil)' ,
318318 line = _l_array ,
319- error = ' bad argument array [1] to fn_array (number expected, got nil)' ,
319+ error = ' bad argument _array [1] to fn_array (number expected, got nil)' ,
320320 },
321321 {
322322 code = ' fn_array(box.NULL)' ,
323323 line = _l_array ,
324- error = ' bad argument array [1] to fn_array (number expected, got nil)' ,
324+ error = ' bad argument _array [1] to fn_array (number expected, got nil)' ,
325325 },
326326 {
327327 code = ' fn_array({})' ,
328328 line = _l_array ,
329- error = ' bad argument array [1] to fn_array (number expected, got nil)' ,
329+ error = ' bad argument _array [1] to fn_array (number expected, got nil)' ,
330330 },
331331 {
332332 code = ' fn_array({"str1"})' ,
333333 line = _l_array ,
334- error = ' bad argument array [1] to fn_array (number expected, got string)' ,
334+ error = ' bad argument _array [1] to fn_array (number expected, got string)' ,
335335 },
336336 {
337337 code = ' fn_array({1})' ,
338338 line = _l_array ,
339- error = ' bad argument array [2] to fn_array (number expected, got nil)' ,
339+ error = ' bad argument _array [2] to fn_array (number expected, got nil)' ,
340340 },
341341 {
342342 code = ' fn_array({1, 2})' ,
343343 },
344344 {
345345 code = ' fn_array({1, 2, 3})' ,
346346 line = _l_array ,
347- error = ' unexpected argument array [3] to fn_array' ,
347+ error = ' unexpected argument _array [3] to fn_array' ,
348348 },
349349
350350 -- fn_table
@@ -356,25 +356,25 @@ local err_cases = {
356356 {
357357 code = ' fn_table()' ,
358358 line = _l_table ,
359- error = ' bad argument table .mykey to fn_table (number expected, got nil)' ,
359+ error = ' bad argument _table .mykey to fn_table (number expected, got nil)' ,
360360 },
361361 {
362362 code = ' fn_table({})' ,
363363 line = _l_table ,
364- error = ' bad argument table .mykey to fn_table (number expected, got nil)' ,
364+ error = ' bad argument _table .mykey to fn_table (number expected, got nil)' ,
365365 },
366366 {
367367 code = ' fn_table({mykey = "str"})' ,
368368 line = _l_table ,
369- error = ' bad argument table .mykey to fn_table (number expected, got string)' ,
369+ error = ' bad argument _table .mykey to fn_table (number expected, got string)' ,
370370 },
371371 {
372372 code = ' fn_table({mykey = 0})' ,
373373 },
374374 {
375375 code = ' fn_table({mykey = 0, excess = 1})' ,
376376 line = _l_table ,
377- error = ' unexpected argument table .excess to fn_table' ,
377+ error = ' unexpected argument _table .excess to fn_table' ,
378378 },
379379
380380 -- fn_inception
@@ -387,7 +387,7 @@ local err_cases = {
387387 {
388388 code = ' fn_inception({we = false})' ,
389389 line = _l_inception ,
390- error = ' bad argument options .we to fn_inception (?table expected, got boolean)' ,
390+ error = ' bad argument _options .we to fn_inception (?table expected, got boolean)' ,
391391 },
392392 {
393393 code = ' fn_inception({we = {}})' ,
@@ -407,7 +407,7 @@ local err_cases = {
407407 {
408408 code = ' fn_inception({we = {need = {to = {go = {deeper = {}}}}}})' ,
409409 line = _l_inception ,
410- error = ' bad argument options .we.need.to.go.deeper to fn_inception (?number expected, got table)' ,
410+ error = ' bad argument _options .we.need.to.go.deeper to fn_inception (?number expected, got table)' ,
411411 },
412412
413413 -- fn_deepcheck
@@ -429,7 +429,7 @@ local err_cases = {
429429 {
430430 code = ' fn_missing_checks()' ,
431431 line = _l_missing_checks ,
432- error = ' checks: argument "arg2 " is not checked' ,
432+ error = ' checks: argument "_arg2 " is not checked' ,
433433 },
434434 {
435435 code = ' bad_check_type_1()' ,
@@ -583,34 +583,34 @@ for _, case in pairs(options_v2_cases) do
583583end
584584
585585---- --------------------------------------------------------------------------
586- function testdata .fn_int64 (arg ) -- luacheck: no unused args
586+ function testdata .fn_int64 (_arg )
587587 checks (' int64' )
588588end
589589
590- function testdata .fn_uint64 (arg ) -- luacheck: no unused args
590+ function testdata .fn_uint64 (_arg )
591591 checks (' uint64' )
592592end
593593
594594local uuid = require (' uuid' )
595595testdata .myid = uuid ()
596596
597- function testdata .fn_uuid (arg ) -- luacheck: no unused args
597+ function testdata .fn_uuid (_arg )
598598 checks (' uuid' )
599599end
600600
601- function testdata .fn_uuid_str (arg ) -- luacheck: no unused args
601+ function testdata .fn_uuid_str (_arg )
602602 checks (' uuid_str' )
603603end
604604
605- function testdata .fn_uuid_bin (arg ) -- luacheck: no unused args
605+ function testdata .fn_uuid_bin (_arg )
606606 checks (' uuid_bin' )
607607end
608608
609- function testdata .fn_tuple (arg ) -- luacheck: no unused args
609+ function testdata .fn_tuple (_arg )
610610 checks (' tuple' )
611611end
612612
613- function testdata .fn_decimal (arg ) -- luacheck: no unused args
613+ function testdata .fn_decimal (_arg )
614614 checks (' decimal' )
615615end
616616
@@ -619,13 +619,13 @@ if has_decimal then
619619 testdata .decimal = decimal
620620end
621621
622- function testdata .fn_error (arg ) -- luacheck: no unused args
622+ function testdata .fn_error (_arg )
623623 checks (' error' )
624624end
625625
626626local has_error = (box .error ~= nil ) and (box .error .new ~= nil )
627627
628- function testdata .fn_datetime (arg ) -- luacheck: no unused args
628+ function testdata .fn_datetime (_arg )
629629 checks (' datetime' )
630630end
631631
@@ -634,7 +634,7 @@ if has_datetime then
634634 testdata .datetime = datetime
635635end
636636
637- function testdata .fn_interval (arg ) -- luacheck: no unused args
637+ function testdata .fn_interval (_arg )
638638 checks (' interval' )
639639end
640640
0 commit comments