diff --git a/lua/cp/init.lua b/lua/cp/init.lua index 9bd8597..c50316e 100644 --- a/lua/cp/init.lua +++ b/lua/cp/init.lua @@ -603,7 +603,10 @@ local function toggle_run_panel(is_debug) state.test_buffers = test_buffers state.test_windows = test_windows local test_state = run.get_run_panel_state() - logger.log(string.format('test panel opened (%d test cases)', #test_state.test_cases), vim.log.levels.INFO) + logger.log( + string.format('test panel opened (%d test cases)', #test_state.test_cases), + vim.log.levels.INFO + ) end ---@param contest_id string @@ -763,7 +766,10 @@ local function handle_cache_command(cmd) logger.log(('cleared cache for %s'):format(cmd.platform), vim.log.levels.INFO, true) else logger.log( - ('unknown platform: %s. Available: %s'):format(cmd.platform, table.concat(platforms, ', ')), + ('unknown platform: %s. Available: %s'):format( + cmd.platform, + table.concat(platforms, ', ') + ), vim.log.levels.ERROR ) end @@ -853,7 +859,7 @@ local function parse_command(args) return { type = 'cache', subcommand = 'clear', - platform = platform + platform = platform, } else return { type = 'error', message = 'unknown cache subcommand: ' .. subcommand } diff --git a/lua/cp/runner/execute.lua b/lua/cp/runner/execute.lua index f53d26a..62c0f99 100644 --- a/lua/cp/runner/execute.lua +++ b/lua/cp/runner/execute.lua @@ -235,7 +235,10 @@ function M.compile_problem(ctx, contest_config, is_debug) if compile_result.code ~= 0 then return { success = false, output = compile_result.stdout or 'unknown error' } end - logger.log(('compilation successful (%s)'):format(is_debug and 'debug mode' or 'test mode'), vim.log.levels.INFO) + logger.log( + ('compilation successful (%s)'):format(is_debug and 'debug mode' or 'test mode'), + vim.log.levels.INFO + ) end return { success = true, output = nil } diff --git a/spec/command_parsing_spec.lua b/spec/command_parsing_spec.lua index 805fa95..6c58538 100644 --- a/spec/command_parsing_spec.lua +++ b/spec/command_parsing_spec.lua @@ -351,7 +351,10 @@ describe('cp command parsing', function() local error_logged = false for _, log_entry in ipairs(logged_messages) do - if log_entry.level == vim.log.levels.ERROR and log_entry.msg:match('cache command requires subcommand') then + if + log_entry.level == vim.log.levels.ERROR + and log_entry.msg:match('cache command requires subcommand') + then error_logged = true break end @@ -366,7 +369,10 @@ describe('cp command parsing', function() local error_logged = false for _, log_entry in ipairs(logged_messages) do - if log_entry.level == vim.log.levels.ERROR and log_entry.msg:match('unknown cache subcommand') then + if + log_entry.level == vim.log.levels.ERROR + and log_entry.msg:match('unknown cache subcommand') + then error_logged = true break end