From 77e53c16439d3bd4a69aaa13399a0eeb9d78ccda Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Fri, 11 Mar 2022 14:30:24 +0100 Subject: [PATCH] home: vim: null-ls: prefer 'pflake8' if available --- home/vim/plugin/settings/null-ls.vim | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/home/vim/plugin/settings/null-ls.vim b/home/vim/plugin/settings/null-ls.vim index bec8124..b2102bd 100644 --- a/home/vim/plugin/settings/null-ls.vim +++ b/home/vim/plugin/settings/null-ls.vim @@ -38,8 +38,14 @@ null_ls.register({ -- Python null_ls.register({ null_ls.builtins.diagnostics.flake8.with({ + -- Only used if available, but prefer pflake8 if available + condition = function() + return utils.is_executable("flake8") and not utils.is_executable("pflake8") + end, + }), + null_ls.builtins.diagnostics.pyproject_flake8.with({ -- Only used if available - condition = utils.is_executable_condition("flake8"), + condition = utils.is_executable_condition("pflake8"), }), null_ls.builtins.diagnostics.mypy.with({ -- Only used if available