Merge pull request #560 from thamenato/feat/python-ruff-format

languages/python: add ruff formatter
This commit is contained in:
raf 2025-01-15 16:11:07 +03:00 committed by GitHub
commit 45a6d9b890
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 28 additions and 3 deletions

View file

@ -41,8 +41,8 @@
[horriblename](https://github.com/horriblename): [horriblename](https://github.com/horriblename):
[aerial.nvim](https://github.com/stevearc/aerial.nvim) [aerial.nvim]: (https://github.com/stevearc/aerial.nvim)
[nvim-ufo](https://github.com/kevinhwang91/nvim-ufo) [nvim-ufo]: (https://github.com/kevinhwang91/nvim-ufo)
- Add [aerial.nvim] - Add [aerial.nvim]
- Add [nvim-ufo] - Add [nvim-ufo]
@ -52,7 +52,8 @@
- Remove `vim.notes.obsidian.setupOpts.dir`, which was set by default. Fixes - Remove `vim.notes.obsidian.setupOpts.dir`, which was set by default. Fixes
issue with setting the workspace directory. issue with setting the workspace directory.
- Add `vim.snippets.luasnip.setupOpts`, which was previously missing. - Add `vim.snippets.luasnip.setupOpts`, which was previously missing.
- Add `"prettierd"` as a formatter option in `vim.languages.markdown.format.type`. - Add `"prettierd"` as a formatter option in
`vim.languages.markdown.format.type`.
[kaktu5](https://github.com/kaktu5): [kaktu5](https://github.com/kaktu5):
@ -63,3 +64,9 @@
[solargraph]: https://github.com/castwide/solargraph [solargraph]: https://github.com/castwide/solargraph
- Add Ruby support under `vim.languages.ruby` using [solargraph]. - Add Ruby support under `vim.languages.ruby` using [solargraph].
[thamenato](https://github.com/thamenato):
[ruff]: (https://github.com/astral-sh/ruff)
- Add [ruff] as a formatter option in `vim.languages.python.format.type`.

View file

@ -106,6 +106,24 @@
) )
''; '';
}; };
ruff = {
package = pkgs.writeShellApplication {
name = "ruff";
runtimeInputs = [pkgs.ruff];
text = ''
ruff format -
'';
};
nullConfig = ''
table.insert(
ls_sources,
null_ls.builtins.formatting.ruff.with({
command = "${cfg.format.package}/bin/ruff",
})
)
'';
};
}; };
defaultDebugger = "debugpy"; defaultDebugger = "debugpy";