From c12afbc6ff50e599139edf9e6f9e93bd83cabae6 Mon Sep 17 00:00:00 2001 From: Dmytro Meleshko Date: Mon, 26 Apr 2021 10:25:01 +0300 Subject: [PATCH] [nvim] move the flake8 config to an external file --- nvim/coc-languages/python.vim | 15 +-------------- python/flake8.ini | 12 ++++++++++++ 2 files changed, 13 insertions(+), 14 deletions(-) create mode 100644 python/flake8.ini diff --git a/nvim/coc-languages/python.vim b/nvim/coc-languages/python.vim index 336cf65..20b80e1 100644 --- a/nvim/coc-languages/python.vim +++ b/nvim/coc-languages/python.vim @@ -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')], \ }, \ } diff --git a/python/flake8.ini b/python/flake8.ini new file mode 100644 index 0000000..b0c0191 --- /dev/null +++ b/python/flake8.ini @@ -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