Browse Source

add black python formatter (#182)

Benjamin Schmidt 4 years ago
parent
commit
4f9a07d428
1 changed files with 3 additions and 0 deletions
  1. 3 0
      lua/lsp/efm-general-ls.lua

+ 3 - 0
lua/lsp/efm-general-ls.lua

@@ -13,6 +13,7 @@ local flake8 = {
 local isort = {formatCommand = "isort --quiet -", formatStdin = true}
 
 local yapf = {formatCommand = "yapf --quiet", formatStdin = true}
+local black = {formatCommand = "black --quiet --stdin-filename ", formatStdin = true}
 
 if O.python.linter == 'flake8' then
 	table.insert(python_arguments, flake8)
@@ -20,6 +21,8 @@ end
 
 if O.python.formatter == 'yapf' then
 	table.insert(python_arguments, yapf)
+elseif O.python.formatter == 'black' then
+    table.insert(python_arguments, black)
 end
 
 if O.python.isort then