-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy path.shellcheckrc
More file actions
59 lines (58 loc) · 2.72 KB
/
.shellcheckrc
File metadata and controls
59 lines (58 loc) · 2.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# ShellCheck configuration for aidevops
#
# SC1091 ("Not following: ... was not specified as input") is disabled globally.
# ShellCheck cannot resolve dynamic source paths like "${SCRIPT_DIR}/foo.sh"
# (255 of 404 scripts use this pattern), so source-path=SCRIPTDIR only partially
# worked and caused catastrophic memory expansion when combined with
# --external-sources (-x): 11 GB RSS, kernel panics, 73 zombie processes.
# See GH#2915, PR#2918, PR#2937 for the full incident chain.
#
# Defense-in-depth: even without source-path, the shellcheck-wrapper.sh strips
# --external-sources from bash-language-server invocations, and SHELLCHECK_PATH
# is set in .zshenv to route through the wrapper for non-interactive shells.
# Project-wide accepted patterns and false positives:
#
# Source resolution:
# SC1091: "Not following: ... was not specified as input" — info-level hint
# that ShellCheck cannot resolve a sourced file. Disabled because 255
# scripts use dynamic paths (${SCRIPT_DIR}/foo.sh) that ShellCheck
# cannot follow, and the previous fix (source-path=SCRIPTDIR) caused
# exponential memory expansion. See header comment.
#
# Library/sourced-file architecture:
# SC2329: "Function is never invoked" — false positive for library functions
# called indirectly via source or test runners
# SC2317: "Command appears unreachable" — false positive for library functions
# and return/exit guard patterns
# SC2034: "Variable appears unused" — false positive for variables set in
# sourced files and used by the sourcing script
#
# Intentional coding patterns:
# SC2001: "See if you can use ${var//search/replace}" — sed is preferred for
# complex patterns and multi-character replacements
# SC2059: "Don't use variables in printf format" — intentional for dynamic
# format strings in helper scripts
# SC2012: "Use find instead of ls" — ls is intentional for simple listings
# where non-alphanumeric filenames are not expected
# SC2030/SC2031: "PATH modified in subshell" — intentional for isolated
# environment setup in subshells
# SC2015: "A && B || C is not if-then-else" — intentional pattern where
# C is a safe fallback (logging, default value)
# SC2129: "Consider using { cmd1; cmd2; } >> file" — style preference
# SC2153: "Possible misspelling" — false positive for UPPER/lower conventions
# SC2004: "$/${} unnecessary on arithmetic variables" — style preference
# SC2009: "Consider using pgrep" — ps|grep is intentional for portability
disable=SC1091
disable=SC2329
disable=SC2317
disable=SC2034
disable=SC2001
disable=SC2059
disable=SC2012
disable=SC2030
disable=SC2031
disable=SC2015
disable=SC2129
disable=SC2153
disable=SC2004
disable=SC2009