[nvim] move the flake8 config to an external file

This commit is contained in:
Dmytro Meleshko 2021-04-26 10:25:01 +03:00
parent f8c01686ee
commit c12afbc6ff
2 changed files with 13 additions and 14 deletions

View File

@ -1,19 +1,6 @@
let g:coc_global_extensions += ['coc-pyright']
let g:coc_filetypes += ['python']
let s:ignored_errors = []
" Indent is not a multiple of 4
let s:ignored_errors += ['E111']
" Indent is not a multiple of 4 for comments
let s:ignored_errors += ['E114']
" Indent for continuation lines is smaller than expected
let s:ignored_errors += ['E121']
" Import not at the top of the file
let s:ignored_errors += ['E402']
" Line too long
let s:ignored_errors += ['E501']
" let g:coc_user_config['pyls.plugins.pycodestyle.ignore'] = s:ignored_errors
" let g:coc_user_config['python.autocomplete.showAdvancedMembers'] = v:false
let g:coc_user_config['python'] = {
\ 'formatting': {
@ -23,6 +10,6 @@ let g:coc_user_config['python'] = {
\ 'linting': {
\ 'pylintEnabled': v:false,
\ 'flake8Enabled': v:true,
\ 'flake8Args': ['--ignore=' . join(s:ignored_errors, ',')],
\ 'flake8Args': ['--config=' . simplify(g:nvim_dotfiles_dir.'/../python/flake8.ini')],
\ },
\ }

12
python/flake8.ini Normal file
View File

@ -0,0 +1,12 @@
[flake8]
ignore =
# Indent is not a multiple of 4
E111
# Indent is not a multiple of 4 for comments
E114
# Indent for continuation lines is smaller than expected
E121
# Import not at the top of the file
E402
# Line too long
E501