Commit Graph

2104 Commits

Author SHA1 Message Date
Vidar Holen
23097320a4 Add support for ${| ..} expansion (fixes #3243) 2025-07-17 12:01:54 -07:00
Vidar Holen
6a758d5dc7 Update with new Bash 5.3 printf formats 2025-07-17 10:53:05 -07:00
Vidar Holen
64b172e090 Merge pull request #3223 from simondeziel/snap-core24-base
snap: switch to `core24` base
2025-07-17 09:23:17 -07:00
Vidar Holen
947a0ebc7f Merge pull request #3238 from polluks/patch-1
Update shellcheck.1.md
2025-07-17 08:44:00 -07:00
Vidar Holen
2ae0aeaff9 Merge branch 'slycordinator-leading_X' 2025-07-17 08:41:07 -07:00
Vidar Holen
c592abb984 Add unit test for #2689 2025-07-17 08:37:58 -07:00
Christopher Slycord
08329b0698 x-prefix: add support for "!=" and X (capital x)
Changes checkComparisonWithLeadingX to:
1) Work with the "!=" operator in addition to "=" and "==".
2) Support prefixing with "x" and "X". This is helpful since some scripts have comparisons like [ "X$var" = "X" ] and the like
2025-07-17 13:14:04 +09:00
Stefan
24891542c2 Update shellcheck.1.md 2025-07-05 12:13:32 +02:00
Simon Deziel
9477e26858 snap: strip executable during installation
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
2025-06-18 16:34:35 -04:00
Simon Deziel
638eb88a5a snap: remove now unneeded libatomic1 stage package
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
2025-06-18 16:01:24 -04:00
Simon Deziel
34f582c81c snap: don't abort on swapon failures
This is needed when building snap on LXD containers.

Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
2025-06-18 15:24:14 -04:00
Simon Deziel
310932be8e snap: modern cabal no longer have sandbox subcommand
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
2025-06-18 15:24:14 -04:00
Simon Deziel
fa99cfd355 snap: replace dd by fallocate (faster)
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
2025-06-18 12:50:29 -04:00
Simon Deziel
133bc8a543 snap: newer mkswap require stricter perms
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
2025-06-18 12:50:07 -04:00
Simon Deziel
677243d5aa snap: switch to core24 base
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
2025-06-18 12:40:34 -04:00
Vidar Holen
20d11c1c33 Merge branch 'e-kwsm-tautologically-false' 2025-05-17 00:56:52 +00:00
Vidar Holen
47d358c1d4 Tighten SC2333/SC2334 to only trigger against literals. 2025-05-17 00:55:50 +00:00
Vidar Holen
ad58768563 Merge branch 'tautologically-false' of github.com:e-kwsm/shellcheck into e-kwsm-tautologically-false 2025-05-12 17:04:34 +00:00
Vidar Holen
62a8ecf9bf Merge branch 'e-kwsm-SC3013' 2025-04-27 16:16:49 -07:00
Vidar Holen
0b5410d759 Merge pull request #3193 from iehrenwald/master
Add python3 to the list of badShells
2025-04-27 16:09:19 -07:00
iehrenwald
975cfeee50 Merge pull request #1 from iehrenwald/add_python3_badshell
Add python3 to the list of badShells
2025-04-25 14:20:01 -04:00
Ian Ehrenwald
b381658dbc Add python3 to the list of badShells 2025-04-25 14:11:07 -04:00
Vidar Holen
950578ae0e Merge branch 'Flu-ignore-sc2015-true' 2025-04-11 19:15:34 -07:00
Vidar Holen
f78714e0f6 Add ":" alongside "true" for SC2015 2025-04-11 19:14:53 -07:00
Vidar Holen
de07ec1c56 Merge branch 'ignore-sc2015-true' of github.com:Flu/shellcheck into Flu-ignore-sc2015-true 2025-04-11 19:14:15 -07:00
Vidar Holen
85066dd805 Merge remote-tracking branch 'refs/remotes/origin/master' 2025-04-11 14:17:29 -07:00
Vidar Holen
140274b810 Merge branch 'e-kwsm-SC3013-unary' 2025-04-11 14:14:36 -07:00
Vidar Holen
dc41f0cc5b Refactor checks for POSIX test flags 2025-04-11 14:14:09 -07:00
Vidar Holen
fbb8386797 Merge pull request #3170 from e-kwsm/SC3012
fix(SC3012)!: do not warn about `\<` and `\>` in test/[] as specified in POSIX.1-2024
2025-04-09 10:51:44 -07:00
Eisuke Kawashima
efb5a5a274 fix(SC3013): check POSIX-compliant unary operators for test and [
fix #2125
2025-04-09 19:21:53 +09:00
Vidar Holen
553a80f77a Also ignore SC2119 for :? and :+. 2025-04-08 21:21:50 -07:00
Vidar Holen
7fc992d0dc Suppress SC2119/SC2120 for ${1:-default} (fixes #2023) 2025-04-08 20:52:52 -07:00
Vidar Holen
c553288085 Merge pull request #3106 from larryv/updatevars-bash-5.3
Recognize internal variables new in bash 5.3
2025-04-08 20:09:29 -07:00
Vidar Holen
1be41dd652 Merge pull request #3082 from silby/oksh
Recognize "oksh" executable name as ksh
2025-04-08 20:08:53 -07:00
Vidar Holen
2eddec86d3 Merge pull request #3185 from e-kwsm/man
doc: update man
2025-04-08 20:08:05 -07:00
Vidar Holen
c41f3a4b8a Warn about [ ! -o opt ] (and -a) being unconditionally true (fixes #3174) 2025-04-08 10:53:52 -07:00
Vidar Holen
574c6d18fb Suggest using test -e instead of -a (fixes #3174). 2025-04-08 10:23:10 -07:00
Eisuke Kawashima
e4853af5b0 doc: update man 2025-04-08 19:31:58 +09:00
Vidar Holen
72af76f443 Supress SC2093 when execfail is set (fixes #3178) 2025-04-06 19:58:13 -07:00
Vidar Holen
8ff0c5be7a Suppress SC2216 when piping to cp/mv/rm -i (fixes #3141). 2025-04-06 19:27:29 -07:00
Eisuke Kawashima
4f628cbe2a feat: check tautologically-false conditionals
- fix #3179 — negation of SC2055, `[ x = y -a x = z]`
- fix #3181 — negation of SC2056, `(( x == y && x == z ))`
- fix #3180 — negation of SC2252, `[ x = y ] && [ x = z ]`
2025-04-04 18:21:35 +09:00
Eisuke Kawashima
bc60607f9e fix(SC3012)!: do not warn about \< and \> in test/[] as specified in POSIX.1-2024
https://pubs.opengroup.org/onlinepubs/9799919799/utilities/test.html
fix #3168
2025-03-24 06:32:32 +09:00
Eisuke Kawashima
3a9ddae06b fix(SC3013)!: remove SC3013 since the operators are specified by POSIX.1-2024
https://pubs.opengroup.org/onlinepubs/9799919799/utilities/test.html
fix #3167
2025-03-24 06:24:12 +09:00
Adrian Fluturel
cbf0b33463 Skip SC2015 when the last command is true 2025-01-07 03:24:29 +01:00
Lawrence Velázquez
fe315a25c4 Recognize internal variables new in bash 5.3
From the bug-bash@gnu.org announcement "Bash-5.3-beta available":

    q. GLOBSORT: new variable to specify how to sort the results of
       pathname expansion (name, size, blocks, mtime, atime, ctime,
       none) in ascending or descending order.

    w. BASH_MONOSECONDS: new dynamic variable that returns the value of
       the system's monotonic clock, if one is available.

    x. BASH_TRAPSIG: new variable, set to the numeric signal number of
       the trap being executed while it's running.

https://lists.gnu.org/archive/html/bug-bash/2024-12/msg00120.html
2024-12-28 03:20:19 -05:00
Joseph C. Sible
d3001f337a Simplify getParseOutput 2024-12-13 23:57:50 -05:00
Joseph C. Sible
7deb7e853b Use mapM_ instead of sequence_ and <$> 2024-12-13 23:47:55 -05:00
Joseph C. Sible
26b949b9b0 Use mapM_ instead of isJust and fromJust 2024-12-13 23:45:32 -05:00
Joseph C. Sible
5adfea21ee Use the result of the comparison directly instead of an if/else 2024-12-13 23:20:48 -05:00
Joseph C. Sible
0ecaf2b5f1 Use foldr instead of explicit recursion 2024-12-13 23:19:36 -05:00