mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 18:58:04 +00:00
Update plugins for Neovim integration docs (#8371)
This PR updates the editor integration section of the documentation for
Neovim.
* Removes the now archived `null-ls` plugin
* Add `nvim-lint` (for linters) and `conform.nvim` (for formatter)
plugins
Screenshot ref: b7032228
-57b1-4141-ae17-e186c4428b61
This commit is contained in:
parent
230c93459f
commit
a8d04cbd88
1 changed files with 23 additions and 11 deletions
|
@ -273,26 +273,38 @@ tools:
|
|||
|
||||
<details>
|
||||
<summary>
|
||||
For neovim users using
|
||||
<a href="https://github.com/jose-elias-alvarez/null-ls.nvim">
|
||||
<code>null-ls</code>
|
||||
</a>, Ruff is already <a href="https://github.com/jose-elias-alvarez/null-ls.nvim">integrated</a>.
|
||||
With the <a href="https://github.com/stevearc/conform.nvim"><code>conform.nvim</code></a> plugin for Neovim.
|
||||
</summary>
|
||||
<br>
|
||||
|
||||
```lua
|
||||
local null_ls = require("null-ls")
|
||||
|
||||
null_ls.setup({
|
||||
sources = {
|
||||
null_ls.builtins.formatting.ruff,
|
||||
null_ls.builtins.diagnostics.ruff,
|
||||
}
|
||||
require("conform").setup({
|
||||
formatters_by_ft = {
|
||||
python = {
|
||||
-- To fix lint errors.
|
||||
"ruff_fix",
|
||||
-- To run the Ruff formatter.
|
||||
"ruff_format",
|
||||
},
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
With the <a href="https://github.com/mfussenegger/nvim-lint"><code>nvim-lint</code></a> plugin for Neovim.
|
||||
</summary>
|
||||
|
||||
```lua
|
||||
require("lint").linters_by_ft = {
|
||||
python = { "ruff" },
|
||||
}
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
## PyCharm (External Tool)
|
||||
|
||||
Ruff can be installed as an [External Tool](https://www.jetbrains.com/help/pycharm/configuring-third-party-tools.html)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue