flake8: New completion
This commit is contained in:
parent
e14617e498
commit
5152356ad1
@ -97,6 +97,7 @@ bashcomp_DATA = 2to3 \
|
||||
filesnarf \
|
||||
find \
|
||||
find_member \
|
||||
flake8 \
|
||||
freebsd-update \
|
||||
freeciv-gtk2 \
|
||||
freeciv-server \
|
||||
|
35
completions/flake8
Normal file
35
completions/flake8
Normal file
@ -0,0 +1,35 @@
|
||||
# flake8 completion -*- shell-script -*-
|
||||
|
||||
_flake8()
|
||||
{
|
||||
local cur prev words cword split
|
||||
_init_completion -s || return
|
||||
|
||||
case $prev in
|
||||
-h|--help|--version|--exclude|--filename|--select|--ignore|\
|
||||
--max-line-length|--max-complexity|--builtins)
|
||||
return
|
||||
;;
|
||||
--format)
|
||||
COMPREPLY=( $( compgen -W 'default pylint' -- "$cur" ) )
|
||||
return
|
||||
;;
|
||||
--config)
|
||||
_filedir
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
$split && return
|
||||
|
||||
if [[ $cur == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
|
||||
[[ $COMPREPLY == *= ]] && compopt -o nospace
|
||||
return
|
||||
fi
|
||||
|
||||
_filedir py
|
||||
} &&
|
||||
complete -F _flake8 flake8
|
||||
|
||||
# ex: ts=4 sw=4 et filetype=sh
|
1
test/completion/flake8.exp
Normal file
1
test/completion/flake8.exp
Normal file
@ -0,0 +1 @@
|
||||
assert_source_completions flake8
|
18
test/lib/completions/flake8.exp
Normal file
18
test/lib/completions/flake8.exp
Normal file
@ -0,0 +1,18 @@
|
||||
proc setup {} {
|
||||
save_env
|
||||
}
|
||||
|
||||
|
||||
proc teardown {} {
|
||||
assert_env_unmodified
|
||||
}
|
||||
|
||||
|
||||
setup
|
||||
|
||||
|
||||
assert_complete_any "flake8 "
|
||||
sync_after_int
|
||||
|
||||
|
||||
teardown
|
Loading…
x
Reference in New Issue
Block a user