xref: /kvm-unit-tests/.shellcheckrc (revision 3b4b978a27f6f7df37875f97470d19d647b2c179)
1*ddfdcc39SNicholas Piggin# shellcheck configuration file
2*ddfdcc39SNicholas Pigginexternal-sources=true
3*ddfdcc39SNicholas Piggin
4*ddfdcc39SNicholas Piggin# Optional extras --  https://www.shellcheck.net/wiki/Optional
5*ddfdcc39SNicholas Piggin# Possibilities, e.g., -
6*ddfdcc39SNicholas Piggin# quote‐safe‐variables
7*ddfdcc39SNicholas Piggin# require-double-brackets
8*ddfdcc39SNicholas Piggin# require-variable-braces
9*ddfdcc39SNicholas Piggin# add-default-case
10*ddfdcc39SNicholas Piggin
11*ddfdcc39SNicholas Piggin# Disable SC2004 style? I.e.,
12*ddfdcc39SNicholas Piggin# In run_tests.sh line 67:
13*ddfdcc39SNicholas Piggin#            if (( $unittest_run_queues <= 0 )); then
14*ddfdcc39SNicholas Piggin#                  ^------------------^ SC2004 (style): $/${} is unnecessary on arithmetic variables.
15*ddfdcc39SNicholas Piggindisable=SC2004
16*ddfdcc39SNicholas Piggin
17*ddfdcc39SNicholas Piggin# Disable SC2086 for now, double quote to prevent globbing and word
18*ddfdcc39SNicholas Piggin# splitting. There are lots of places that use it for word splitting
19*ddfdcc39SNicholas Piggin# (e.g., invoking commands with arguments) that break. Should have a
20*ddfdcc39SNicholas Piggin# more consistent approach for this (perhaps use arrays for such cases)
21*ddfdcc39SNicholas Piggin# but for now disable.
22*ddfdcc39SNicholas Piggin# SC2086 (info): Double quote to prevent globbing and word splitting.
23*ddfdcc39SNicholas Piggindisable=SC2086
24*ddfdcc39SNicholas Piggin
25*ddfdcc39SNicholas Piggin# Disable SC2235.  Most developers are used to seeing expressions
26*ddfdcc39SNicholas Piggin# like a || (b && c), not a || { b && c ; }. The subshell overhead in
27*ddfdcc39SNicholas Piggin# kvm-unit-tests is negligible as it's not shell-heavy in the first
28*ddfdcc39SNicholas Piggin# place (time is dominated by qemu startup/shutdown and test execution)
29*ddfdcc39SNicholas Piggin# SC2235 (style): Use { ..; } instead of (..) to avoid subshell overhead.
30*ddfdcc39SNicholas Piggindisable=SC2235
31