mirror of
https://github.com/mawww/kakoune.git
synced 2024-11-29 01:24:52 +03:00
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 &
|
||||
|
Loading…
Reference in New Issue
Block a user