diff dot_config/nvim/lua/efm/python.lua @ 323:3b25f3aa7014

Use efm folders to store efm configuration per language To add a language configuration: - create a file under lua/efm/<filetype>.lua - require the langauges table from efm/languages - add the configuration
author zegervdv <zegervdv@me.com>
date Mon, 21 Dec 2020 17:16:16 +0100
parents
children 3b7ebcd563e1
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dot_config/nvim/lua/efm/python.lua	Mon Dec 21 17:16:16 2020 +0100
@@ -0,0 +1,20 @@
+local languages = require'efm/languages'
+
+languages.python = {};
+
+if (vim.fn.executable('black') == 1) then
+  table.insert(languages.python, {
+    formatCommand = "black -",
+    formatStdin = true
+  })
+end
+
+if (vim.fn.executable('flake8') == 1) then
+  table.insert(languages.python, {
+    lintCommand = "flake8 --stdin-display-name ${INPUT} -",
+    lintStdin = true,
+    lintIgnoreExitCode = true,
+    lintFormats = {"%f:%l:%c: %m"}
+  })
+end
+