summaryrefslogtreecommitdiffstats
path: root/lua/conform/formatters/black.lua
diff options
context:
space:
mode:
authorSteven Arcangeli <stevearc@stevearc.com>2023-08-25 11:15:12 -0700
committerSteven Arcangeli <stevearc@stevearc.com>2023-08-25 11:43:47 -0700
commiteb5987e9dd40ce1e27c9c07e41d09571f1bd876e (patch)
treeb4cffe35e0893272cedc0ecf0229d08be343d70e /lua/conform/formatters/black.lua
parent100fd00d40423af85c4c7efcf875f8e4ee329f50 (diff)
feat: first working version
Diffstat (limited to 'lua/conform/formatters/black.lua')
-rw-r--r--lua/conform/formatters/black.lua19
1 files changed, 19 insertions, 0 deletions
diff --git a/lua/conform/formatters/black.lua b/lua/conform/formatters/black.lua
new file mode 100644
index 0000000..0d892a2
--- /dev/null
+++ b/lua/conform/formatters/black.lua
@@ -0,0 +1,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",
+ }),
+}