2019-10-25 14:25:48 +02:00
|
|
|
" Create the `b:undo_ftplugin` variable if it doesn't exist
|
|
|
|
call ftplugined#check_undo_ft()
|
2019-10-25 14:15:56 +02:00
|
|
|
|
2019-10-10 10:46:13 +02:00
|
|
|
" Use my desired ALE fixers for python
|
|
|
|
let b:ale_fixers=[ 'black', 'isort' ]
|
2019-10-13 19:33:20 +02:00
|
|
|
let b:undo_ftplugin.='|unlet b:ale_fixers'
|
2019-10-10 10:46:13 +02:00
|
|
|
" Use my desired ALE linters for python
|
|
|
|
let b:ale_linters=[ 'flake8', 'mypy', 'pylint', 'pyls' ]
|
2019-10-13 19:33:20 +02:00
|
|
|
let b:undo_ftplugin.='|unlet b:ale_linters'
|
2019-10-10 10:46:13 +02:00
|
|
|
|
2019-10-25 14:01:19 +02:00
|
|
|
" Use pyls inside the python environment if needed
|
2019-10-10 17:54:03 +02:00
|
|
|
let b:ale_python_pyls_auto_pipenv=1
|
2019-10-13 19:33:20 +02:00
|
|
|
let b:undo_ftplugin.='|unlet b:ale_python_pyls_auto_pipenv'
|
2019-10-10 17:54:03 +02:00
|
|
|
|
2019-10-10 10:46:13 +02:00
|
|
|
" Disable pycodestyle checks from pyls because I'm already using flake8
|
|
|
|
let b:ale_python_pyls_config={
|
|
|
|
\ 'pyls': {
|
|
|
|
\ 'plugins': {
|
|
|
|
\ 'pycodestyle': {
|
|
|
|
\ 'enabled': v:false
|
|
|
|
\ },
|
|
|
|
\ },
|
|
|
|
\ },
|
|
|
|
\ }
|
2019-10-13 19:33:20 +02:00
|
|
|
let b:undo_ftplugin.='|unlet b:ale_python_pyls_config'
|
2019-10-08 16:42:23 +02:00
|
|
|
|
2019-10-25 14:01:19 +02:00
|
|
|
" Don't use mypy to check for syntax errors
|
|
|
|
let b:ale_python_mypy_ignore_invalid_syntax=1
|
|
|
|
let b:undo_ftplugin.='|unlet b:ale_python_mypy_ignore_invalid_syntax'
|
|
|
|
" Use mypy inside the python environment if needed
|
|
|
|
let b:ale_python_mypy_auto_pipenv=1
|
|
|
|
let b:undo_ftplugin.='|unlet b:ale_python_mypy_auto_pipenv'
|
|
|
|
|
2019-11-19 15:22:20 +01:00
|
|
|
" Automatically format files when saving them
|
|
|
|
let b:ale_fix_on_save=1
|
|
|
|
let b:undo_ftplugin='|unlet b:ale_lint_on_save'
|
|
|
|
|
2019-10-08 16:42:23 +02:00
|
|
|
" Change max length of a line to 88 for this buffer to match black's settings
|
|
|
|
setlocal colorcolumn=88
|
2019-10-13 19:33:20 +02:00
|
|
|
let b:undo_ftplugin.='|setlocal colorcolumn<'
|