Commit Graph

130 Commits

Author SHA1 Message Date
Vidar Holen fd595d1058 Only trigger SC2316 on unquoted words. 2022-05-06 10:06:12 -07:00
Patrick Xia fa15c0a454 add SC2316: error on multiple declarations like 'readonly local' 2022-05-05 16:19:07 -07:00
Vidar Holen 88cdb4e2c9 Warn about spaces around = in alias (fixes #2442) 2022-02-03 19:23:46 -08:00
Ville Skyttä c5de58ae84 Comment spelling fixes 2021-11-13 12:50:53 +02:00
Vidar Holen 3b6972fbf1 Update copyright years 2021-11-06 19:07:34 -07:00
Vidar Holen 0dd5c67bdf Warn about [^..] in Dash (fixes #2361) 2021-10-21 21:00:39 -07:00
Vidar Holen c3aaa27540 Skip SC2214 if variable is modified in loop (fixes #2351) 2021-10-09 12:13:41 -07:00
Vidar Holen 3aedda766d For `while getopts; do case ..` checks, make sure variable matches 2021-10-09 11:40:52 -07:00
Vidar Holen 205ba429b3 Warn about `read foo[i]` expanding as glob (fixes #2345) 2021-10-07 18:50:44 -07:00
Christian Nassif-Haynes 093df8cb24 Add extra checks for masked return codes 2021-10-02 01:36:40 +10:00
Vidar Holen 081f7eba24 Fix parsing of [$var] (fixes #2309) 2021-08-26 23:05:14 -07:00
Vidar Holen 5b6fd60279 Improve warnings for expr (fixes #2033) 2021-08-22 21:12:58 -07:00
Vidar Holen da7b28213e Recognize wait -p as assigning a variable (fixes #2179) 2021-08-17 21:53:27 -07:00
Vidar Holen e5745568e8 Extend warnings about spaces around = to 'let' 2021-08-08 15:48:50 -07:00
Vidar Holen a44f3edb14 Warn about eval'ing arrays 2021-07-30 18:46:19 -07:00
Vidar Holen 754ab22d94 Warn about unquoted blanks in echo (fixes #377) 2021-07-26 18:59:33 -07:00
Vidar Holen 44471b73cc Have SC2155 trigger on 'typeset' as well (fixes #2262) 2021-07-25 17:34:14 -07:00
Vidar Holen 9eb63c97e6 Re-add warnings about 'declare var = value' (fixes #2279) 2021-07-24 13:25:56 -07:00
Matthias Diener 087865c680
Clarify 'which' 2021-03-20 20:43:18 -05:00
Vidar Holen 15ff87cf80
Merge pull request #2119 from josephcsible/refactors
Various refactorings
2021-02-02 18:14:27 -08:00
Vidar Holen 9584266a8b Escape control characters when adding user data to messages 2020-12-31 12:28:48 -08:00
Joseph C. Sible 2cfd1f2714 Fuse maps 2020-12-28 18:13:34 -05:00
Joseph C. Sible 8480563672 Use syntactic sugar instead of building lists by hand 2020-12-28 18:13:34 -05:00
Joseph C. Sible 0607039d41 Simplify actualArgs 2020-12-28 17:21:47 -05:00
Vidar Holen b625562d60 Add POSIX checks for more Bash-specific variables (fixes #2093) 2020-12-05 20:11:12 -08:00
Vidar Holen 3104cec770 SC2267: Warn about xargs -i (fixes #2058) 2020-10-18 22:10:14 -07:00
Vidar Holen f100c2939e Rewrite getopts style option parser 2020-10-18 21:34:58 -07:00
Vidar Holen c4cc2debb7 Improve compatibility checks 2020-09-07 21:05:49 -07:00
Vidar Holen cfd68ee0c2 Give each sh/dash compatibility warning its own SC3xxx error code 2020-09-01 16:48:14 -07:00
Vidar Holen 9e59bcca91 Upgrade SC2169 (unsupported in dash) from warning to error (fixes #2013) 2020-08-23 15:49:20 -07:00
Vidar Holen 14e6806092 Handle literal linefeeds in printf format strings (fixes #2007) 2020-07-25 17:36:22 -07:00
Vidar Holen 5d753212fb Improve handling of command prefixes like exec/command (fixes #2008) 2020-07-25 13:45:05 -07:00
Vidar Holen 5b86777f9d Warn about non-POSIX case modification expansions (fixes #1977) 2020-07-22 17:32:00 -07:00
Vidar Holen 75863a887e
Merge pull request #1918 from josephcsible/getsuspiciousregexwildcard
Clean up and optimize getSuspiciousRegexWildcard
2020-04-12 15:32:00 -07:00
Vidar Holen 30523555af
Merge pull request #1906 from josephcsible/shellsupport
Simplify ShellSupport
2020-04-12 15:22:52 -07:00
Vidar Holen 58d3e50f43
Merge pull request #1905 from josephcsible/skiprepeating
Make skipRepeating lazier and faster
2020-04-12 15:21:39 -07:00
Vidar Holen 73cc11fd0a
Merge pull request #1901 from josephcsible/bracedstring
Mostly get rid of bracedString
2020-04-12 15:14:50 -07:00
Joseph C. Sible 163c710ba7 Clean up and optimize getSuspiciousRegexWildcard 2020-04-12 16:15:45 -04:00
Joseph C. Sible 999b7e2596 Get rid of bracedString everywhere it's easy to 2020-04-11 19:24:11 -04:00
Joseph C. Sible a9d564a8bc Combine bracedString into getSingleUnmodifiedVariable
Everywhere we used getSingleUnmodifiedVariable, we just called bracedString on
the result. Move this into that function instead, and rename it accordingly.
2020-04-11 19:23:13 -04:00
Joseph C. Sible 8a6679fd8a Remove unnecessary fromMaybe and when from bashism 2020-04-05 22:03:50 -04:00
Joseph C. Sible facf0d1e27 Write getLiteralArgs with foldr and without fromMaybe or monads 2020-04-05 21:59:27 -04:00
Joseph C. Sible cd38afce26 Make it slightly lazier still (and more clear) 2020-04-05 21:46:08 -04:00
Joseph C. Sible 5084ba8d7e Make skipRepeating lazier and faster 2020-04-05 21:39:14 -04:00
Joseph C. Sible ed331b816b Simplify warnRedundant 2020-04-05 20:32:39 -04:00
Joseph C. Sible cfa2a663af Simplify checkSetAssignment 2020-04-05 20:30:37 -04:00
Joseph C. Sible df4928f4e3 Use MultiWayIf instead of case-matching on () 2020-04-05 20:30:37 -04:00
Joseph C. Sible 9747b1d5c3 Simplify checkArg 2020-04-05 20:10:56 -04:00
Joseph C. Sible fa841cb270 Prefer pattern matching in undirected 2020-04-05 20:08:02 -04:00
Joseph C. Sible e8501151dd Use a guard instead of unless 2020-04-05 20:04:54 -04:00