@@ -1023,7 +1023,7 @@ spec/samples/python_code.lua:1:6: (E011) expected '=' near '__future__'
10231023 end )
10241024
10251025 it (" expands folders" , function ()
1026- assert .matches (" ^Total: %d+ warnings / %d+ errors in 27 files\n $" , get_output " spec/samples -qqq --no-config --exclude-files spec/samples/global_fields.lua" )
1026+ assert .matches (" ^Total: %d+ warnings / %d+ errors in 28 files\n $" , get_output " spec/samples -qqq --no-config --exclude-files spec/samples/global_fields.lua" )
10271027 end )
10281028
10291029 it (" uses --include-files when expanding folders" , function ()
@@ -1242,6 +1242,7 @@ Checking spec/samples/globals.lua 2 warnings
12421242Checking spec/samples/indirect_globals.lua 3 warnings
12431243Checking spec/samples/inline_options.lua 7 warnings / 2 errors
12441244Checking spec/samples/line_length.lua 8 warnings
1245+ Checking spec/samples/minetest.lua 2 warnings
12451246Checking spec/samples/python_code.lua 1 error
12461247Checking spec/samples/read_globals.lua 5 warnings
12471248Checking spec/samples/read_globals_inline_options.lua 3 warnings
@@ -1252,7 +1253,7 @@ Checking spec/samples/unused_secondaries.lua 4 warnings
12521253Checking spec/samples/utf8.lua 4 warnings
12531254Checking spec/samples/utf8_error.lua 1 error
12541255
1255- Total: 73 warnings / 9 errors in 20 files
1256+ Total: 75 warnings / 9 errors in 21 files
12561257]] ):gsub (" (spec/samples)/" , " %1" .. package.config :sub (1 , 1 )),
12571258 get_output " spec/samples --config=spec/configs/exclude_files_config.luacheckrc -qq --exclude-files spec/samples/global_fields.lua" )
12581259 end )
@@ -1268,6 +1269,7 @@ Checking globals.lua 2 warnings
12681269Checking indirect_globals.lua 3 warnings
12691270Checking inline_options.lua 7 warnings / 2 errors
12701271Checking line_length.lua 8 warnings
1272+ Checking minetest.lua 2 warnings
12711273Checking python_code.lua 1 error
12721274Checking read_globals.lua 5 warnings
12731275Checking read_globals_inline_options.lua 3 warnings
@@ -1278,7 +1280,7 @@ Checking unused_secondaries.lua 4 warnings
12781280Checking utf8.lua 4 warnings
12791281Checking utf8_error.lua 1 error
12801282
1281- Total: 73 warnings / 9 errors in 20 files
1283+ Total: 75 warnings / 9 errors in 21 files
12821284]] , get_output (" . --config=spec/configs/exclude_files_config.luacheckrc -qq --exclude-files global_fields.lua" , " spec/samples/" ))
12831285 end )
12841286
@@ -1293,6 +1295,7 @@ Checking globals.lua 2 warnings
12931295Checking indirect_globals.lua 3 warnings
12941296Checking inline_options.lua 7 warnings / 2 errors
12951297Checking line_length.lua 8 warnings
1298+ Checking minetest.lua 2 warnings
12961299Checking python_code.lua 1 error
12971300Checking redefined.lua 7 warnings
12981301Checking reversed_fornum.lua 1 warning
@@ -1301,7 +1304,7 @@ Checking unused_secondaries.lua 4 warnings
13011304Checking utf8.lua 4 warnings
13021305Checking utf8_error.lua 1 error
13031306
1304- Total: 65 warnings / 9 errors in 18 files
1307+ Total: 67 warnings / 9 errors in 19 files
13051308]] , get_output (" . --config=spec/configs/exclude_files_config.luacheckrc -qq --exclude-files global_fields.lua --exclude-files " .. quote (" ./read*" ), " spec/samples/" ))
13061309 end )
13071310
@@ -1351,6 +1354,17 @@ Total: 1 warning / 0 errors in 1 file
13511354]] , get_output " spec/samples/globals.lua --config=spec/configs/import_config.luacheckrc" )
13521355 end )
13531356
1357+ describe (" responds to builtin std preset" , function ()
1358+ it (" minetest" , function ()
1359+ -- make sure minetest sample has something that normally throws a lint error
1360+ assert .equal (1 , get_exitcode " spec/samples/minetest.lua --no-config" )
1361+ -- turning on minetest std should pass all lints
1362+ assert .equal (0 , get_exitcode " spec/samples/minetest.lua --no-config --std minetest" )
1363+ -- confirm minetest std set isn't just blindly allowing anything
1364+ assert .equal (1 , get_exitcode " spec/samples/sample.rockspec --no-config --std minetest" )
1365+ end )
1366+ end )
1367+
13541368 describe (" global path" , function ()
13551369 setup (function ()
13561370 os.rename (" .luacheckrc" , " .luacheckrc.bak" )
0 commit comments