Skip to content

Commit b4d809c

Browse files
isaksamstenF1lipB
authored andcommitted
feat: ruff (nvim-lua#41)
1 parent 3db6662 commit b4d809c

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ To view configured and available formatters, as well as to see the path to the l
187187
- [prettierd](https://github.com/fsouza/prettierd) - prettier, as a daemon, for ludicrous formatting speed.
188188
- [rubocop](https://github.com/rubocop/rubocop) - Ruby static code analyzer and formatter, based on the community Ruby style guide.
189189
- [rustfmt](https://github.com/rust-lang/rustfmt) - A tool for formatting rust code according to style guidelines.
190+
- [ruff](https://github.com/astral-sh/ruff) - An extremely fast Python linter, written in Rust.
190191
- [scalafmt](https://github.com/scalameta/scalafmt) - Code formatter for Scala.
191192
- [shellharden](https://github.com/anordal/shellharden) - The corrective bash syntax highlighter
192193
- [shfmt](https://github.com/mvdan/sh) - A shell parser, formatter, and interpreter with `bash` support.

lua/conform/formatters/ruff.lua

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
return {
2+
meta = {
3+
url = "https://beta.ruff.rs/docs/",
4+
description = "An extremely fast Python linter, written in Rust.",
5+
},
6+
command = "ruff",
7+
args = {
8+
"--fix",
9+
"-e",
10+
"-n",
11+
"--stdin-filename",
12+
"$FILENAME",
13+
"-",
14+
},
15+
stdin = true,
16+
cwd = require("conform.util").root_file({
17+
"pyproject.toml",
18+
}),
19+
}

0 commit comments

Comments
 (0)