fix(ci): format
This commit is contained in:
parent
4aa16d2858
commit
95f4761b61
3 changed files with 24 additions and 7 deletions
|
|
@ -127,9 +127,14 @@ function M.setup(user_config)
|
|||
for lang_name, lang_config in pairs(contest_config) do
|
||||
if type(lang_config) == "table" and lang_config.extension then
|
||||
if not vim.tbl_contains(vim.tbl_keys(filetype_to_language), lang_config.extension) then
|
||||
error(("Invalid extension '%s' for language '%s' in contest '%s'. Valid extensions: %s"):format(
|
||||
lang_config.extension, lang_name, contest_name, table.concat(vim.tbl_keys(filetype_to_language), ", ")
|
||||
))
|
||||
error(
|
||||
("Invalid extension '%s' for language '%s' in contest '%s'. Valid extensions: %s"):format(
|
||||
lang_config.extension,
|
||||
lang_name,
|
||||
contest_name,
|
||||
table.concat(vim.tbl_keys(filetype_to_language), ", ")
|
||||
)
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -306,7 +306,10 @@ end
|
|||
|
||||
local function parse_command(args)
|
||||
if #args == 0 then
|
||||
return { type = "error", message = "Usage: :CP <platform> <contest> [problem] [--lang=<language>] | :CP <action> | :CP <problem>" }
|
||||
return {
|
||||
type = "error",
|
||||
message = "Usage: :CP <platform> <contest> [problem] [--lang=<language>] | :CP <action> | :CP <problem>",
|
||||
}
|
||||
end
|
||||
|
||||
local language = nil
|
||||
|
|
@ -344,7 +347,13 @@ local function parse_command(args)
|
|||
return { type = "contest_setup", platform = first, contest = filtered_args[2], language = language }
|
||||
end
|
||||
elseif #filtered_args == 3 then
|
||||
return { type = "full_setup", platform = first, contest = filtered_args[2], problem = filtered_args[3], language = language }
|
||||
return {
|
||||
type = "full_setup",
|
||||
platform = first,
|
||||
contest = filtered_args[2],
|
||||
problem = filtered_args[3],
|
||||
language = language,
|
||||
}
|
||||
else
|
||||
return { type = "error", message = "Too many arguments" }
|
||||
end
|
||||
|
|
|
|||
|
|
@ -42,7 +42,10 @@ end, {
|
|||
num_args = num_args + 1
|
||||
end
|
||||
|
||||
local lang_flag_present = vim.tbl_contains(args, "--lang") or vim.iter(args):any(function(arg) return arg:match("^--lang=") end)
|
||||
local lang_flag_present = vim.tbl_contains(args, "--lang")
|
||||
or vim.iter(args):any(function(arg)
|
||||
return arg:match("^--lang=")
|
||||
end)
|
||||
|
||||
if num_args == 2 then
|
||||
local candidates = { "--lang" }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue