mirror of https://github.com/astral-sh/ruff
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: https://github.com/astral-sh/ruff/assets/67177269/b7032228-57b1-4141-ae17-e186c4428b61
This commit is contained in:
parent
230c93459f
commit
a8d04cbd88
|
|
@ -273,26 +273,38 @@ tools:
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>
|
<summary>
|
||||||
For neovim users using
|
With the <a href="https://github.com/stevearc/conform.nvim"><code>conform.nvim</code></a> plugin for Neovim.
|
||||||
<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>.
|
|
||||||
</summary>
|
</summary>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
local null_ls = require("null-ls")
|
require("conform").setup({
|
||||||
|
formatters_by_ft = {
|
||||||
null_ls.setup({
|
python = {
|
||||||
sources = {
|
-- To fix lint errors.
|
||||||
null_ls.builtins.formatting.ruff,
|
"ruff_fix",
|
||||||
null_ls.builtins.diagnostics.ruff,
|
-- To run the Ruff formatter.
|
||||||
}
|
"ruff_format",
|
||||||
|
},
|
||||||
|
},
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
</details>
|
</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)
|
## PyCharm (External Tool)
|
||||||
|
|
||||||
Ruff can be installed as an [External Tool](https://www.jetbrains.com/help/pycharm/configuring-third-party-tools.html)
|
Ruff can be installed as an [External Tool](https://www.jetbrains.com/help/pycharm/configuring-third-party-tools.html)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue