summaryrefslogtreecommitdiffstats
path: root/lua/conform/formatters/ruff_fix.lua
blob: ecf3ed7eec4256d6cf4ef93ac40492fa64bc51dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
---@type conform.FileFormatterConfig
return {
  meta = {
    url = "https://docs.astral.sh/ruff/",
    description = "An extremely fast Python linter, written in Rust. Fix lint errors.",
  },
  command = "ruff",
  args = {
    "check",
    "--fix",
    "--force-exclude",
    "--exit-zero",
    "--no-cache",
    "--stdin-filename",
    "$FILENAME",
    "-",
  },
  stdin = true,
  cwd = require("conform.util").root_file({
    "pyproject.toml",
    "ruff.toml",
    ".ruff.toml",
  }),
}