fix(style): add parentheses (#471)

Signed-off-by: Aaron Pham <contact@aarnphm.xyz>
This commit is contained in:
Aaron Pham
2024-09-03 05:12:07 -04:00
committed by GitHub
parent 8cc674f1da
commit 0d8098e4eb
25 changed files with 213 additions and 214 deletions

View File

@@ -1,7 +1,7 @@
---NOTE: user will be merged with defaults and
---we add a default var_accessor for this table to config values.
local Utils = require "avante.utils"
local Utils = require("avante.utils")
---@class avante.CoreConfig: avante.Config
local M = {}
@@ -100,7 +100,7 @@ You are an excellent programming expert.
support_paste_from_clipboard = false,
},
history = {
storage_path = vim.fn.stdpath "state" .. "/avante",
storage_path = vim.fn.stdpath("state") .. "/avante",
paste = {
extension = "png",
filename = "pasted-%Y-%m-%d-%H-%M-%S",
@@ -188,7 +188,7 @@ M.providers = {}
---@param opts? avante.Config
function M.setup(opts)
vim.validate { opts = { opts, "table", true } }
vim.validate({ opts = { opts, "table", true } })
M.options = vim.tbl_deep_extend(
"force",
@@ -214,7 +214,7 @@ function M.setup(opts)
return acc
end)
vim.validate { provider = { M.options.provider, "string", false } }
vim.validate({ provider = { M.options.provider, "string", false } })
M.diff = vim.tbl_deep_extend(
"force",
@@ -227,14 +227,14 @@ function M.setup(opts)
for k, v in pairs(M.options.vendors) do
M.options.vendors[k] = type(v) == "function" and v() or v
end
vim.validate { vendors = { M.options.vendors, "table", true } }
vim.validate({ vendors = { M.options.vendors, "table", true } })
M.providers = vim.list_extend(M.providers, vim.tbl_keys(M.options.vendors))
end
end
---@param opts? avante.Config
function M.override(opts)
vim.validate { opts = { opts, "table", true } }
vim.validate({ opts = { opts, "table", true } })
M.options = vim.tbl_deep_extend("force", M.options, opts or {})
if not M.options.silent_warning then
@@ -254,7 +254,7 @@ function M.override(opts)
M.options.vendors[k] = type(v) == "function" and v() or v
if not vim.tbl_contains(M.providers, k) then M.providers = vim.list_extend(M.providers, { k }) end
end
vim.validate { vendors = { M.options.vendors, "table", true } }
vim.validate({ vendors = { M.options.vendors, "table", true } })
end
end
@@ -269,7 +269,7 @@ M.support_paste_image = function(skip_warning)
skip_warning = skip_warning or M.silent_warning
if skip_warning then return end
return Utils.has "img-clip.nvim" or Utils.has "img-clip"
return Utils.has("img-clip.nvim") or Utils.has("img-clip")
end
M.get_window_width = function() return math.ceil(vim.o.columns * (M.windows.width / 100)) end