aboutsummaryrefslogtreecommitdiffstats
path: root/lua/conform/formatters/black.lua
blob: e27ed90d5edc2d01d2aaf5a6be5bf36f6ea7e08b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
local util = require("conform.util")
---@type conform.FileFormatterConfig
return {
  meta = {
    url = "https://github.com/psf/black",
    description = "The uncompromising Python code formatter.",
  },
  command = "black",
  args = {
    "--stdin-filename",
    "$FILENAME",
    "--quiet",
    "-",
  },
  cwd = util.root_file({
    -- https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#configuration-via-a-file
    "pyproject.toml",
  }),
}