aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIsak Samsten <isak@samsten.se>2023-09-14 17:09:41 +0200
committerGitHub <noreply@github.com>2023-09-14 08:09:41 -0700
commitfdc4a0f05c21012f2445a993ebdad700380dcfbf (patch)
tree938eab4f3596cec5f933bcdfc87e6b1e0592e5cb
parent808c7e045d50dcb2ad512ea7fa94baf411654a95 (diff)
feat: ruff (#41)
-rw-r--r--README.md1
-rw-r--r--lua/conform/formatters/ruff.lua19
2 files changed, 20 insertions, 0 deletions
diff --git a/README.md b/README.md
index 4a9fdfc..41dd443 100644
--- a/README.md
+++ b/README.md
@@ -187,6 +187,7 @@ To view configured and available formatters, as well as to see the path to the l
- [prettierd](https://github.com/fsouza/prettierd) - prettier, as a daemon, for ludicrous formatting speed.
- [rubocop](https://github.com/rubocop/rubocop) - Ruby static code analyzer and formatter, based on the community Ruby style guide.
- [rustfmt](https://github.com/rust-lang/rustfmt) - A tool for formatting rust code according to style guidelines.
+- [ruff](https://github.com/astral-sh/ruff) - An extremely fast Python linter, written in Rust.
- [scalafmt](https://github.com/scalameta/scalafmt) - Code formatter for Scala.
- [shellharden](https://github.com/anordal/shellharden) - The corrective bash syntax highlighter
- [shfmt](https://github.com/mvdan/sh) - A shell parser, formatter, and interpreter with `bash` support.
diff --git a/lua/conform/formatters/ruff.lua b/lua/conform/formatters/ruff.lua
new file mode 100644
index 0000000..854ac06
--- /dev/null
+++ b/lua/conform/formatters/ruff.lua
@@ -0,0 +1,19 @@
+return {
+ meta = {
+ url = "https://beta.ruff.rs/docs/",
+ description = "An extremely fast Python linter, written in Rust.",
+ },
+ command = "ruff",
+ args = {
+ "--fix",
+ "-e",
+ "-n",
+ "--stdin-filename",
+ "$FILENAME",
+ "-",
+ },
+ stdin = true,
+ cwd = require("conform.util").root_file({
+ "pyproject.toml",
+ }),
+}