Reformatting, no tabs and fixed indentation.
This commit is contained in:
parent
6f6b04ef5f
commit
9dee71e7c3
|
@ -10,6 +10,7 @@ def flake8-lint -params 0..1 -docstring "Lint the contents of the current buffer
|
|||
echo "set buffer flake8_tmp_dir ${dir}"
|
||||
echo "write ${dir}/buf"
|
||||
}
|
||||
|
||||
# end the previous %sh{} so that its output gets interpreted by kakoune
|
||||
# before launching the following as a background task.
|
||||
%sh{
|
||||
|
@ -27,18 +28,15 @@ def flake8-lint -params 0..1 -docstring "Lint the contents of the current buffer
|
|||
# not hang while flake8 is running.
|
||||
(
|
||||
flake8 --ignore=${kak_opt_flake8_options} - < ${dir}/buf > ${dir}/stderr
|
||||
|
||||
flags=$(cat ${dir}/stderr | sed -rne "
|
||||
/^stdin:[0-9]+:[0-9]+:? (W|F|C|N).*/ { s/^stdin:([0-9]+):.*/\1|{yellow}█/; p }
|
||||
/^stdin:[0-9]+:[0-9]+:? E.*/ { s/^stdin:([0-9]+):.*/\1|{red}█/; p }
|
||||
" | paste -s -d ':')
|
||||
|
||||
errors=$(cat ${dir}/stderr | sed -rne "
|
||||
/^stdin:[0-9]+:[0-9]+:?.*/ { s/^stdin:([0-9]+):([0-9]+:)? (.*) /\1,\3/; s/'/\\\\'/g; p }
|
||||
" | sort -n)
|
||||
|
||||
sed -e "s|<stdin>|${kak_bufname}|g" < ${dir}/stderr > ${dir}/fifo
|
||||
|
||||
echo "set 'buffer=${kak_buffile}' flake8_flags %{${kak_timestamp}:${flags}}
|
||||
set 'buffer=${kak_buffile}' flake8_errors '${errors}'" | kak -p ${kak_session}
|
||||
) > /dev/null 2>&1 < /dev/null &
|
||||
|
@ -80,4 +78,4 @@ def flake8-diagnostics-next -docstring "Jump to the next line that contains an e
|
|||
echo 'echo -color Error no next flake8 diagnostic'
|
||||
fi
|
||||
)
|
||||
} }
|
||||
}}
|
||||
|
|
Loading…
Reference in New Issue
Block a user