-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to disable Ruff linter in AstroNvim LSP? #12795
Comments
Have you tried setting lint.enable If you need more help, please share your neovim configuration. |
Sent request. My config is used by AstroNvim. I tried to put the code at different places, but still nothing seems to work. |
Can you share your Neovim config? I'm specifically interested in how you've setup basedpyright and Ruff. Which plugins are you using to set them up? Is it just |
Basically, My -- if true then return {} end -- INFO: REMOVE THIS LINE TO ACTIVATE THIS FILE
return {
"AstroNvim/astrolsp",
opts = {
servers = {
"basedpyright",
},
---@diagnostic disable: missing-fields
config = {
basedpyright = {
before_init = function(_, c)
if not c.settings then c.settings = {} end
if not c.settings.python then c.settings.python = {} end
c.settings.python.pythonPath = vim.fn.exepath "python"
end,
settings = {
basedpyright = {
analysis = {
-- ignore = { "*" },
-- autoImportCompletions = true,
-- autoSearchPaths = true,
diagnosticMode = "openFilesOnly",
useLibraryCodeForTypes = true,
-- reportMissingImports = true,
typeCheckingMode = "standard",
},
},
},
},
},
},
} |
I'm not familiar with AstroNvim but are you saying that Ruff is configured to be the default linter in that framework and you're interested in using Ruff only as a formatter? I couldn't find any references to "ruff" in the repository (https://github.com/search?q=repo:AstroNvim/AstroNvim%20ruff&type=code). It's a bit difficult to help without knowing the way you've configured Ruff in your editor 😅 |
That's the point, it isn't configured at all, but still works. I will ask in a forum of AstroNvim for this and provide the answer once it's gotten here. |
Here how you, presumably, can configure the same code in AstroNvim:
return {
"AstroNvim/astrolsp",
opts = {
config = {
ruff_lsp = {
settings = {
ruff = {
lint = {
enable = false,
},
},
},
},
},
},
} |
But still I get the same double-linting. Will be waiting for the reply from AstroTeam. |
Can you confirm (via docs?) the name of the Ruff server as defined in the plugin? Is it |
This was resolved by correctly adding the code from the ruff documentation. No issue here on the ruff side 😄 return {
"AstroNvim/astrolsp",
opts = {
config = {
ruff = {
init_options = {
settings = {
lint = { enable = false },
},
},
},
},
},
} |
Yeah, it's true. Thank you a lot! |
Is there anyway to disable
ruff
linting completely and leave it only for formattiong? I'm using a NeoVim configuration with Mason. What I have is a double display for linting inbasedpyright
andruff
:The text was updated successfully, but these errors were encountered: