From be143d408bee9f52b5ef5ca40b11bff646f952a4 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Sun, 21 Sep 2025 11:42:53 -0400 Subject: [PATCH] fix(ci): keep mocks for stubs, but ignore unused param --- spec/fzf_lua_spec.lua | 2 +- spec/picker_spec.lua | 16 ++++++++-------- spec/scraper_spec.lua | 12 ++++++------ spec/telescope_spec.lua | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/spec/fzf_lua_spec.lua b/spec/fzf_lua_spec.lua index 2b5af04..eb6f3e8 100644 --- a/spec/fzf_lua_spec.lua +++ b/spec/fzf_lua_spec.lua @@ -6,7 +6,7 @@ describe('cp.fzf_lua', function() package.preload['fzf-lua'] = function() return { - fzf_exec = function() end, + fzf_exec = function(_, _) end, } end end) diff --git a/spec/picker_spec.lua b/spec/picker_spec.lua index eb50d7c..f628a00 100644 --- a/spec/picker_spec.lua +++ b/spec/picker_spec.lua @@ -40,7 +40,7 @@ describe('cp.picker', function() describe('get_contests_for_platform', function() it('returns empty list when scraper fails', function() - vim.system = function() + vim.system = function(_, _) return { wait = function() return { code = 1, stderr = 'test error' } @@ -54,7 +54,7 @@ describe('cp.picker', function() end) it('returns empty list when JSON is invalid', function() - vim.system = function() + vim.system = function(_, _) return { wait = function() return { code = 0, stdout = 'invalid json' } @@ -68,7 +68,7 @@ describe('cp.picker', function() end) it('returns contest list when scraper succeeds', function() - vim.system = function() + vim.system = function(_, _) return { wait = function() return { @@ -106,7 +106,7 @@ describe('cp.picker', function() it('returns problems from cache when available', function() local cache = require('cp.cache') cache.load = function() end - cache.get_contest_data = function() + cache.get_contest_data = function(_, _) return { problems = { { id = 'a', name = 'Problem A' }, @@ -128,10 +128,10 @@ describe('cp.picker', function() local scrape = require('cp.scrape') cache.load = function() end - cache.get_contest_data = function() + cache.get_contest_data = function(_, _) return nil end - scrape.scrape_contest_metadata = function() + scrape.scrape_contest_metadata = function(_, _) return { success = true, problems = { @@ -151,10 +151,10 @@ describe('cp.picker', function() local scrape = require('cp.scrape') cache.load = function() end - cache.get_contest_data = function() + cache.get_contest_data = function(_, _) return nil end - scrape.scrape_contest_metadata = function() + scrape.scrape_contest_metadata = function(_, _) return { success = false, error = 'test error', diff --git a/spec/scraper_spec.lua b/spec/scraper_spec.lua index 67c1daa..0b1ceeb 100644 --- a/spec/scraper_spec.lua +++ b/spec/scraper_spec.lua @@ -129,7 +129,7 @@ describe('cp.scrape', function() describe('system dependency checks', function() it('handles missing uv executable', function() - vim.fn.executable = function(cmd) + vim.fn.executable = function(_) return cmd == 'uv' and 0 or 1 end @@ -140,7 +140,7 @@ describe('cp.scrape', function() end) it('handles python environment setup failure', function() - vim.system = function(cmd) + vim.system = function(_) if cmd[1] == 'ping' then return { wait = function() @@ -172,7 +172,7 @@ describe('cp.scrape', function() end) it('handles network connectivity issues', function() - vim.system = function(cmd) + vim.system = function(_) if cmd[1] == 'ping' then return { wait = function() @@ -231,7 +231,7 @@ describe('cp.scrape', function() end) it('handles subprocess execution failure', function() - vim.system = function(cmd) + vim.system = function(_) if cmd[1] == 'ping' then return { wait = function() @@ -262,7 +262,7 @@ describe('cp.scrape', function() describe('json parsing', function() it('handles invalid json output', function() - vim.system = function(cmd) + vim.system = function(_) if cmd[1] == 'ping' then return { wait = function() @@ -290,7 +290,7 @@ describe('cp.scrape', function() end) it('handles scraper-reported failures', function() - vim.system = function(cmd) + vim.system = function(_) if cmd[1] == 'ping' then return { wait = function() diff --git a/spec/telescope_spec.lua b/spec/telescope_spec.lua index bf310ef..794fecc 100644 --- a/spec/telescope_spec.lua +++ b/spec/telescope_spec.lua @@ -14,7 +14,7 @@ describe('cp.telescope', function() package.preload['telescope.pickers'] = function() return { - new = function() + new = function(_, _) return { find = function() end, }