Mercurial > dotfiles
comparison 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 |
comparison
equal
deleted
inserted
replaced
322:deb606f02fc4 | 323:3b25f3aa7014 |
---|---|
1 local languages = require'efm/languages' | |
2 | |
3 languages.python = {}; | |
4 | |
5 if (vim.fn.executable('black') == 1) then | |
6 table.insert(languages.python, { | |
7 formatCommand = "black -", | |
8 formatStdin = true | |
9 }) | |
10 end | |
11 | |
12 if (vim.fn.executable('flake8') == 1) then | |
13 table.insert(languages.python, { | |
14 lintCommand = "flake8 --stdin-display-name ${INPUT} -", | |
15 lintStdin = true, | |
16 lintIgnoreExitCode = true, | |
17 lintFormats = {"%f:%l:%c: %m"} | |
18 }) | |
19 end | |
20 |