feat: use clippy with defaults

This commit is contained in:
itsscb 2025-04-02 15:42:09 +02:00
parent c37e059b22
commit 6bab5d0f2f

View File

@ -674,30 +674,34 @@ require('lazy').setup({
-- - capabilities (table): Override fields in capabilities. Can be used to disable certain LSP features. -- - capabilities (table): Override fields in capabilities. Can be used to disable certain LSP features.
-- - settings (table): Override the default settings passed when initializing the server. -- - settings (table): Override the default settings passed when initializing the server.
-- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
local powershell_es = {} local powershell_es = {}
if vim.loop.os_uname().sysname == "Windows_NT" then if vim.loop.os_uname().sysname == 'Windows_NT' then
powershell_es = { powershell_es = {
bundle_path = vim.fn.stdpath("data") .. "/mason/packages/powershell-editor-services", bundle_path = vim.fn.stdpath 'data' .. '/mason/packages/powershell-editor-services',
cmd = { cmd = {
"pwsh", 'pwsh',
"-NoLogo", '-NoLogo',
"-NoProfile", '-NoProfile',
"-Command", '-Command',
vim.fn.stdpath("data") .. '/mason/packages/powershell-editor-services/PowerShellEditorServices/Start-EditorServices.ps1' .. vim.fn.stdpath 'data'
" -HostName 'nvim' -HostProfileId 0 -HostVersion '1.0.0' -LogPath \"" .. .. '/mason/packages/powershell-editor-services/PowerShellEditorServices/Start-EditorServices.ps1'
vim.fn.stdpath("cache") .. "/powershell_es.log" .. .. " -HostName 'nvim' -HostProfileId 0 -HostVersion '1.0.0' -LogPath \""
"\" -SessionDetailsPath \"" .. .. vim.fn.stdpath 'cache'
vim.fn.stdpath("cache") .. "/powershell_es.session.json" .. .. '/powershell_es.log'
"\" -BundledModulesPath \"" .. .. '" -SessionDetailsPath "'
vim.fn.stdpath("data") .. "/mason/packages/powershell-editor-services" .. .. vim.fn.stdpath 'cache'
"\" -EnableConsoleRepl -LanguageServiceOnly -Stdio" .. '/powershell_es.session.json'
.. '" -BundledModulesPath "'
.. vim.fn.stdpath 'data'
.. '/mason/packages/powershell-editor-services'
.. '" -EnableConsoleRepl -LanguageServiceOnly -Stdio',
}, },
filetypes = { "ps1", "psm1", "psd1" }, filetypes = { 'ps1', 'psm1', 'psd1' },
} }
end end
local servers = { local servers = {
-- clangd = {}, -- clangd = {},
-- gopls = {}, -- gopls = {},
@ -705,6 +709,10 @@ require('lazy').setup({
rust_analyzer = { rust_analyzer = {
settings = { settings = {
['rust-analyzer'] = { ['rust-analyzer'] = {
checkOnSave = {
command = 'clippy',
extraArgs = {'--', '-D', 'warnings', '-W', 'clippy::single_match', '-W', 'clippy::single_match_else', '-W', 'clippy::needless_match', '-W', 'clippy::needless_late_init', '-W', 'clippy::redundant_pattern_matching', '-W', 'clippy::redundant_pattern', '-W', 'clippy::redundant_guards', '-W', 'clippy::collapsible_match', '-W', 'clippy::match_single_binding', '-W', 'clippy::match_same_arms', '-W', 'clippy::match_ref_pats', '-W', 'clippy::match_bool', '-D', 'clippy::needless_bool', '-W', 'clippy::unwrap_used', '-W', 'clippy::expect_used' },
},
diagnostics = { diagnostics = {
enable = false, enable = false,
}, },