summaryrefslogtreecommitdiffstats
path: root/lua/conform/formatters/black.lua
blob: 0d892a28082041da419f91f218ce20414a72a798 (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.FormatterConfig
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",
  }),
}