Skip to content
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

languages/python: add ruff formatter #560

Merged
merged 4 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions docs/release-notes/rl-0.8.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@

[horriblename](https://github.com/horriblename):

[aerial.nvim](https://github.com/stevearc/aerial.nvim)
[nvim-ufo](https://github.com/kevinhwang91/nvim-ufo)
[aerial.nvim]: (https://github.com/stevearc/aerial.nvim)
[nvim-ufo]: (https://github.com/kevinhwang91/nvim-ufo)

- Add [aerial.nvim]
- Add [nvim-ufo]
Expand All @@ -52,7 +52,8 @@
- Remove `vim.notes.obsidian.setupOpts.dir`, which was set by default. Fixes
issue with setting the workspace directory.
- 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):

Expand All @@ -63,3 +64,9 @@
[solargraph]: https://github.com/castwide/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`.
18 changes: 18 additions & 0 deletions modules/plugins/languages/python.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Loading