File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -5,11 +5,18 @@ _comp_cmd_pylint_message_ids()
5
5
local filter=p
6
6
[[ ${2-} ]] && filter=" /^$2 messages/,/^$/p"
7
7
# 6: arbitrary, assumed no ids shorter than that
8
- _comp_delimited , -W " $(
8
+ # TODO(scop): The fallback here is slow, maybe memoize whether
9
+ # --list-msgs-enabled worked (>= 2.4.0) and avoid unnecessary tries
10
+ # again later?
11
+ local msgs=" $(
12
+ set -o pipefail
9
13
${1:- pylint} --list-msgs-enabled 2> /dev/null |
10
14
command sed -ne " $filter " |
11
- command sed -ne ' s/^[[:space:]]\{1,\}\([a-z-]\{6,\}\).*/\1/p'
15
+ command sed -ne ' s/^[[:space:]]\{1,\}\([a-z-]\{6,\}\).*/\1/p' ||
16
+ ${1:- pylint} --list-msgs 2> /dev/null |
17
+ command sed -ne ' s/^:\([a-z-]\{6,\}\).*/\1/p'
12
18
) "
19
+ _comp_delimited , -W " $msgs "
13
20
}
14
21
15
22
_pylint ()
You can’t perform that action at this time.
0 commit comments