Vidar Holen
fe81dc1c27
Optionally suggest [[ over [ in Bash scripts (-o require-double-brackets) ( fixes #887 )
2021-07-27 18:53:30 -07:00
Vidar Holen
fbc8d2cb2f
Don't consider [ -n/-z/-v $var ] assignments for subshell modification ( fixes #2217 )
2021-07-27 09:33:22 -07:00
Vidar Holen
c471e45822
Allow printf/return/assignments after exec ( fixes #2249 )
2021-07-26 19:32:33 -07:00
Vidar Holen
754ab22d94
Warn about unquoted blanks in echo ( fixes #377 )
2021-07-26 18:59:33 -07:00
Vidar Holen
4956b006ac
Fix broken test from previous commit
2021-07-25 19:56:51 -07:00
Vidar Holen
02e07625d1
Warn about quoting in assignments to sh declaration utilities ( fixes #1556 )
2021-07-25 19:36:42 -07:00
Vidar Holen
44471b73cc
Have SC2155 trigger on 'typeset' as well ( fixes #2262 )
2021-07-25 17:34:14 -07:00
Vidar Holen
364c33395e
Don't print colors when $TERM is 'dumb' or unset ( fixes #2260 )
2021-07-25 14:44:35 -07:00
Vidar Holen
0d58337cdd
Don't warn about repeated range in [[ -v arr[xxx] ]] ( fixes #2285 )
2021-07-25 13:01:57 -07:00
Vidar Holen
9eb63c97e6
Re-add warnings about 'declare var = value' ( fixes #2279 )
2021-07-24 13:25:56 -07:00
Vidar Holen
8be60028ef
Don't warn when line starts with &> ( fixes #2281 )
2021-07-22 19:25:48 -07:00
Vidar Holen
9b077e28cb
Add :/. to chars recognized for \alias suppression ( fixes #2287 )
2021-07-21 16:44:21 -07:00
Vidar Holen
99f6554c9b
SC2181: Add '!' in suggestion as appropriate ( fixes #2189 )
2021-07-18 16:59:45 -07:00
Vidar Holen
022bc8277c
Merge pull request #2238 from bcran/legacy-backticks-msg
...
Fix typo in SC2006 message: "backticked" vs "backticks"
2021-07-02 09:55:18 -07:00
Vidar Holen
5e60f1eddb
Merge pull request #2241 from Kamilcuk/master
...
Add a comma to function characters
2021-07-02 09:54:51 -07:00
Vidar Holen
163b2f12e2
Sanity check command names ( fixes #2227 )
2021-06-05 18:16:22 -07:00
Kamil Cukrowski
5100960303
Add a comma to function characters
...
Bash has very relaxed function name rules and a comma is also a valid
character. This commit silences SC1036 check when a function name has a
comma in its name.
2021-05-26 10:58:38 +02:00
Rebecca Cran
b61a7658d6
Fix typo in SC2006 message: "backticked" vs "backticks"
2021-05-24 13:33:50 -06:00
Vidar Holen
331e89be99
Fix bad warning for ${#arr[*]}. Fixes #2218 .
2021-04-26 10:44:33 -07:00
Vidar Holen
fe25a2b00e
Treat ${arr[*]} like $* for SC2048
2021-04-24 17:08:10 -07:00
Vidar Holen
9e60b3ea84
Fix haddock failures ( fixes #2216 )
2021-04-22 22:17:51 -07:00
Vidar Holen
5669eb2203
Make x-comparison warning default
2021-04-11 15:52:13 -07:00
Matthias Diener
087865c680
Clarify 'which'
2021-03-20 20:43:18 -05:00
Vidar Holen
98952df35b
Improve warnings on backslashes in comments
2021-03-20 18:12:39 -07:00
Vidar Holen
a277efdbb1
Merge branch 'comment-backslash' of https://github.com/m-ildefons/shellcheck into m-ildefons-comment-backslash
2021-03-20 13:34:40 -07:00
Vidar Holen
ecdc21b0b7
Merge pull request #2112 from pepeiborra/patch-1
...
Add Haddock markup to SystemInterface
2021-03-14 13:16:29 -07:00
Vidar Holen
f02c297fdd
Merge parser and analyzer shebang parsing
2021-03-11 23:04:17 -08:00
Vidar Holen
ea83b602d7
Merge branch 'busybox' of https://github.com/austin987/shellcheck into austin987-busybox
2021-03-11 21:44:17 -08:00
Vidar Holen
83435c4f2e
Merge pull request #2134 from kolyshkin/podman-sc2016
...
Whitelist podman for SC2016 about '$var'
2021-03-07 20:48:58 -08:00
Vidar Holen
a69d6cb661
Merge pull request #2117 from brother/patch-1
...
Change error 2076 to a warning.
2021-03-07 20:47:53 -08:00
Moritz Röhrich
d6bb8fc0d8
Error on backslash in comment #2132
...
- Report error in case of a backspace in a comment
Backspaces in comments are no good. In most cases they are the result of
commenting out a longer line, that was broken down. This usually results
in the shell treating the following lines as their own commands on their
own lines instead of as parts of the longer, broken down line.
2021-02-14 19:13:29 +01:00
Claudio Bley
8bb5e01401
Allow `env` to have flags and variables in shebang
...
The `env` command has a `-S,--split-string` option which enables
having arguments for the command in a shebang.
Also, one could use variable assignments for the command since
`env` treats only the first word without a `=` character as the
command to run.
Fixes #2143 .
2021-02-12 10:53:54 +01:00
Austin English
2e59eba6eb
add support for `/bin/busybox sh` shebang
2021-02-05 19:56:44 -06:00
Vidar Holen
15ff87cf80
Merge pull request #2119 from josephcsible/refactors
...
Various refactorings
2021-02-02 18:14:27 -08:00
Kir Kolyshkin
99e9d5c54b
Whitelist podman for SC2016 about '$var'
...
Same as 08d2eef411
but for podman.
Fixes https://github.com/koalaman/shellcheck/issues/2057
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2021-01-27 16:21:44 -08:00
Vidar Holen
dff8f9492a
Improve SC2283 message and position
2021-01-05 10:07:39 -08:00
Vidar Holen
2e5c56b270
Parse heredocs correctly with carriage returns ( fixes #2103 )
2020-12-31 13:19:14 -08:00
Vidar Holen
9584266a8b
Escape control characters when adding user data to messages
2020-12-31 12:28:48 -08:00
Vidar Holen
5fbaae2bb3
Don't treat ${!x@} as reference of x ( fixes #2116 )
2020-12-30 20:55:18 -08:00
Vidar Holen
fbb14d6b38
Improve checks for = in command names ( fixes #2102 )
2020-12-30 20:30:43 -08:00
Joseph C. Sible
2cfd1f2714
Fuse maps
2020-12-28 18:13:34 -05:00
Joseph C. Sible
953d9bc56d
Remove unused helper stub
2020-12-28 18:13:34 -05:00
Joseph C. Sible
e272fa04ee
Remove redundant bind and return
2020-12-28 18:13:34 -05:00
Joseph C. Sible
81e84c2939
Use execState instead of snd . runState
2020-12-28 18:13:34 -05:00
Joseph C. Sible
34939ca0b7
Fuse map into any
2020-12-28 18:13:34 -05:00
Joseph C. Sible
e7820479f0
Use find
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
dfbcc9595e
Use mapM instead of reimplementing it
2020-12-28 17:48:58 -05:00
Joseph C. Sible
2c0766825e
Implement groupByLink in terms of foldr
2020-12-28 17:45:11 -05:00
Joseph C. Sible
cb4f4e7edc
Use mapM_ instead of reimplementing it
2020-12-28 17:34:52 -05:00
Joseph C. Sible
0607039d41
Simplify actualArgs
2020-12-28 17:21:47 -05:00
Joseph C. Sible
46f177b5be
Simplify parseArgs
2020-12-28 17:19:08 -05:00
Joseph C. Sible
eaccd3d02c
Simplify parser
2020-12-28 17:19:08 -05:00
Joseph C. Sible
35033a9f2f
Remove unnecessary use of Maybe from shellFor
2020-12-28 17:09:50 -05:00
Martin Bagge / brother
19355226e1
Change error 2076 to a warning.
...
Implementing the suggestion by @pixarbuff #1985 .
2020-12-27 00:27:36 +01:00
Pepe Iborra
4e7e3f9456
Add Haddock markup to SystemInterface
2020-12-22 09:15:57 +00:00
Vidar Holen
bd3299edd3
Treat 'exec $1' like '$1' for the purpose of quoting ( fixes #2068 )
2020-12-17 20:31:45 -08:00
Vidar Holen
cc3884cf9f
Support env -S/--split-string in shebangs ( fixes #2105 )
2020-12-12 20:24:32 -08:00
Vidar Holen
6ba1af0898
Warn when a variable is assigned to itself
2020-12-11 20:28:36 -08:00
Vidar Holen
8e332ce879
Improve handling of trailing tokens for []/compounds ( fixes #2091 )
2020-12-06 21:26:24 -08:00
Vidar Holen
b625562d60
Add POSIX checks for more Bash-specific variables ( fixes #2093 )
2020-12-05 20:11:12 -08:00
Vidar Holen
65044c2568
SC2095: Also warn if the command is backgrounded
2020-11-29 13:01:23 -08:00
Keith Smiley
619662adb6
Add readonly to SC2155
...
This adds a warning for readonly masking the return value of function.
This is mentioned in the wiki
https://github.com/koalaman/shellcheck/wiki/SC2155#problematic-code-in-the-case-of-readonly
but didn't actually produce a warning.
Fixes https://github.com/koalaman/shellcheck/issues/1336
2020-10-23 17:29:04 -07:00
Vidar Holen
28d3279ba6
Optional style warning about [ x$var = xval ]
2020-10-19 20:04:58 -07:00
Vidar Holen
256457c47a
Use getopts parser to find 'read' arrays ( fixes #2073 )
2020-10-18 22:57:16 -07: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
8d99926554
Recognize `local -x` similarly to `export` ( fixes #2069 )
2020-10-18 15:15:31 -07:00
Vidar Holen
218deb6d01
Update SC2091/SC2092 message and ignore in quotes.
2020-09-08 19:30:13 -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
58783ab3cc
Allow specifying ranges in disable directives
2020-09-01 16:22:15 -07:00
Vidar Holen
43191fa71d
Suppress SC2035 for echo * and printf * ( fixes #2036 )
2020-09-01 14:19:28 -07:00
Vidar Holen
c9be7ab2eb
Parse assignments according to spec ( fixes #2022 )
2020-08-23 18:46:13 -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
a62d9f10c2
Warn when using &/| between test statements
2020-08-23 15:43:33 -07:00
Vidar Holen
50067ddf94
Consider variables in -z/-n tests to be checked
2020-08-08 12:32:20 -07:00
Vidar Holen
3fa5b7d3bd
Merge branch 'supportMinusNZ' of https://github.com/donnerpeter/shellcheck into donnerpeter-supportMinusNZ
2020-08-08 11:22:00 -07:00
Vidar Holen
e779aedac3
Modernize getting mapfile array name
2020-08-07 16:41:18 -07:00
Vidar Holen
3ef1175566
Merge branch 'issue_1759_mapfile_proc_substition' of https://github.com/Gandalf-/shellcheck into Gandalf--issue_1759_mapfile_proc_substition
2020-08-07 15:57:59 -07:00
Vidar Holen
3e50a2fce8
Suppress SC2216 for du --files0-from or --exclude-from ( fixes #1286 )
2020-08-07 14:59:34 -07:00
Vidar Holen
1ac2c31728
Warn when shell functions blatantly recurse ( fixes #1994 )
2020-07-27 21:50:33 -07:00
Vidar Holen
cc81bdee31
Improve SC1033/SC1034 message
2020-07-27 18:44:07 -07:00
Vidar Holen
34885142e7
Handle tilde expansion in pattern matching ( fixes #1769 )
2020-07-27 18:34:42 -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
210cdcd01a
Treat $x/ or $(x)/ as ./ when finding sourced files ( fixes #1998 )
2020-06-28 17:24:07 -07:00
Vidar Holen
b52f58473d
Merge pull request #1999 from aureliojargas/patch-1
...
SC1102: Fix typo in error message: substition
2020-06-28 16:04:56 -07:00
Vidar Holen
739eaadbf5
Warn about extra spaces between ((s in for((;;))
2020-06-28 16:01:15 -07:00
Aurelio Jargas
a61d8a232c
SC1102: Fix typo in error message: substition
2020-06-26 02:13:33 +02:00
Vidar Holen
12d9c1b76d
Clarify that SC1090 refers to ShellCheck, not sh
2020-06-24 11:50:27 -07:00
Vidar Holen
5cf2c00ff7
Warn about defining and using an alias in a single command ( fixes #1807 )
2020-05-25 23:24:33 -07:00
Vidar Holen
a08ad3bee9
Count $# as an argument reference in SC2120
2020-05-25 23:24:33 -07:00
Vidar Holen
c2a15ce8e9
Allow disabling SC1072/SC1073 with annotations ( fixes #1931 )
2020-05-03 21:57:16 -07:00
Vidar Holen
d6adbfde78
Improve SC2259/60/61 messages
2020-05-03 21:46:16 -07:00
Vidar Holen
2030b83607
Warn about duplicate uses of stdin/out/err
2020-05-03 11:54:25 -07:00
Vidar Holen
8aa40c43ed
Merge pull request #1926 from scop/spelling
...
Spelling fixes
2020-05-02 18:39:44 -07:00
Ville Skyttä
60e80e4ce1
Spelling fixes
2020-04-25 08:29:38 +03:00
Joseph C. Sible
e0daa936d2
Revert "Use fromRight instead of reimplementing it"
...
We still support GHC 8.0, which didn't have fromRight.
This reverts commit 64c31d9142
.
2020-04-24 22:14:08 -04: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
413f0048b8
Merge pull request #1917 from josephcsible/thenskip
...
Simplify thenSkip, and use in another location
2020-04-12 15:26:36 -07:00
Vidar Holen
e7b5fb9742
Merge pull request #1907 from josephcsible/formatters
...
Clean up formatters
2020-04-12 15:23:17 -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
Vidar Holen
ab1610b004
Merge pull request #1903 from josephcsible/fixer
...
Only perform the comparisons once
2020-04-11 17:23:51 -07:00
Vidar Holen
148468be70
Merge pull request #1904 from josephcsible/commands
...
Simplify Commands
2020-04-11 17:23:39 -07:00
Vidar Holen
5eac721fcf
Merge pull request #1902 from josephcsible/astlib
...
Clean up ASTLib
2020-04-11 17:23:08 -07:00
Joseph C. Sible
b58bb4ba9d
Move bracedString to be local to its last use site
2020-04-11 19:24:11 -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
8a7497c4f0
Simplify checkVariableBraces
2020-04-11 19:23:13 -04:00
Vidar Holen
1eac0d7340
Merge pull request #1900 from josephcsible/analyzerlib
...
Clean up AnalyzerLib
2020-04-11 16:21:20 -07:00
Vidar Holen
f8c1ffb0dc
Merge pull request #1898 from josephcsible/nameexpansion
...
Simplify nameExpansion
2020-04-11 16:18:54 -07:00
Joseph C. Sible
3e17a20965
Simplify thenSkip, and use in another location
2020-04-11 17:29:28 -04:00
Joseph C. Sible
1c6202dba4
Avoid some awkward parentheses with forM_
2020-04-05 22:25:19 -04:00
Joseph C. Sible
64c31d9142
Use fromRight instead of reimplementing it
2020-04-05 22:23:22 -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
Joseph C. Sible
9027a9239f
Use pattern matching instead of snd
2020-04-05 20:03:17 -04:00
Joseph C. Sible
773e98868d
Use foldr in checkFindNameGlob
2020-04-05 19:53:40 -04:00
Joseph C. Sible
d45ab327b0
Only perform the comparisons once
2020-04-05 19:45:28 -04:00
Joseph C. Sible
0f9b0f18a4
Remove unnecessary cases from wordToPseudoGlob
2020-04-05 19:30:21 -04:00
Joseph C. Sible
322842b57e
Remove unnecessary monadicity from wordToPseudoGlob
2020-04-05 19:29:40 -04:00
Joseph C. Sible
b6cff5ea0e
Simplify getAssociativeArrays
2020-04-05 19:06:30 -04:00
Joseph C. Sible
8f105074fe
Simplify getCommandNameAndToken
2020-04-05 19:01:56 -04:00
Joseph C. Sible
d22e0aa4a7
Simplify process
...
Note to self: This is a lot like foldr or traverse, and would be trivial to
implement as such if it didn't need to peek ahead when takesArg is true. I
wonder if there's a clean way to implement it in terms of one of them anyway.
2020-04-05 16:45:45 -04:00
Joseph C. Sible
fb55072302
Implement supportsArrays with pattern-matching
2020-04-05 16:30:59 -04:00
Joseph C. Sible
0cc5ed4563
Don't bother with asks if you're just immediately binding the result anyway
2020-04-05 16:25:43 -04:00
Joseph C. Sible
ca41440a67
Simplify getSpecial
2020-04-05 16:21:07 -04:00
Joseph C. Sible
1cf0aa25e9
Simplify dropPrefix
2020-04-05 16:19:18 -04:00
Joseph C. Sible
4604066c37
Use head instead of (!! 0)
2020-04-05 16:16:12 -04:00
Joseph C. Sible
2ebf522a52
Simplify isArrayFlag
2020-04-05 16:13:55 -04:00
Joseph C. Sible
e4eb2d157f
Remove an unnecessary operator section
2020-04-05 16:13:55 -04:00
Joseph C. Sible
f109f9ab92
Remove unnecessary as-patterns
2020-04-05 16:13:55 -04:00
Joseph C. Sible
67e091674e
Remove unnecessary maybeToList
...
The functions we use here are polymorphic enough to work in the [] monad,
so there's no point to use them in the Maybe monad and then convert.
2020-04-05 16:13:54 -04:00
Joseph C. Sible
f833ee3d5a
Use a list comprehension instead of a concatMap with extra lists
2020-04-05 15:54:12 -04:00
Joseph C. Sible
f55d8c45e5
Simplify causesSubshell
2020-04-05 15:54:12 -04:00
Joseph C. Sible
14ee462ccd
Use execState instead of reimplementing it
2020-04-05 15:50:42 -04:00
Joseph C. Sible
b3c04ce3d0
Implement findFirst in terms of foldr
2020-04-05 15:50:42 -04:00
Joseph C. Sible
b0dbc79f69
Remove unnecessary Maybe from isQuoteFreeElement
2020-04-05 15:07:36 -04:00
Joseph C. Sible
2a8170ba05
Use force instead of reimplementing it
2020-04-05 15:01:57 -04:00
Vidar Holen
01f4423465
Disable SC2257 about > $((i=42)) for Dash
2020-04-05 11:38:22 -07:00
Joseph C. Sible
d2fa88dd91
Simplify nameExpansion
2020-04-05 14:04:23 -04:00
Vidar Holen
bd717c9d1b
Don't warn about [ 0 -ne $FOO ] || [ 0 -ne $BAR ] ( fixes #1891 )
2020-04-01 22:09:00 -07:00
Vidar Holen
da0931740f
Merge pull request #1876 from fork-graveyard/master
...
recognize `: ${parameter=word}` as assignment
2020-04-01 18:52:53 -07:00
Vidar Holen
c60323fb25
Merge pull request #1873 from josephcsible/checkwhilereadpitfalls
...
Simplify checkWhileReadPitfalls
2020-03-31 19:10:53 -07:00
Vidar Holen
db11e2f663
Merge pull request #1872 from josephcsible/checkforinquoted
...
Simplify checkForInQuoted
2020-03-31 19:10:25 -07:00
Joseph C. Sible
8cf037fe5e
Fix #1892 : Use pattern synonyms to clean up AST
2020-03-28 18:38:07 -04:00
Vidar Holen
7963eeab9d
Include shebang in AST traversal ( fixes #1858 )
2020-03-16 21:36:41 -07:00
girst
7a5e261d03
recognize `: ${parameter=word}` as assignment
2020-03-16 23:04:54 +01:00
Joseph C. Sible
9d5363377e
Simplify checkWhileReadPitfalls
...
* Clean up usage of not
* Use a case match instead of sequence_ and a do block
2020-03-16 00:14:22 -04:00
Joseph C. Sible
86d470c74f
Simplify checkForInQuoted
...
* Avoid some unnecessary fmaps
* Reuse an identical pattern-match for two guards
* Apply De Morgan's law
* Use forM_ to avoid an unnecessary where
2020-03-15 16:05:55 -04:00
Vidar Holen
a57f6d2886
Improve detection of for loops with single values
2020-03-15 11:30:56 -07:00
Vidar Holen
d28c8f883f
Merge pull request #1865 from josephcsible/patch-1
...
Use headOrDefault instead of fromMaybe and listToMaybe
2020-03-14 21:21:13 -07:00
Vidar Holen
c43b19f897
Make SC2095 (ssh in while read loops) more robust and suggest fixes
2020-03-14 21:15:47 -07:00
Joseph C. Sible
45a67e7c64
Use headOrDefault instead of fromMaybe and listToMaybe
2020-03-10 13:27:52 -04:00
Austin English
741d499b3d
src/ShellCheck/Analytics.hs: suggest using a shell directive for SC2148
2020-03-07 19:23:35 -06:00
Vidar Holen
7b998239af
SC2257: Warn when changing arithmetic variables in redirections
2020-02-17 18:16:57 -08:00
Vidar Holen
4c9210af79
Inspect 'alias' commands for referenced variables ( Fixes #1832 )
2020-02-17 14:20:21 -08:00
Vidar Holen
a75219e525
Remove unused instance Ord Replacement ( fixes #1829 )
2020-02-17 12:44:38 -08:00
Vidar Holen
99d6df8a08
Bump SC1102/SC1105 about ambiguous `$((` to Error ( fixes #1836 )
2020-02-17 12:27:24 -08:00
Vidar Holen
106f321cf0
Parse keywords with case sensitivity ( fixes #1809 )
2020-02-17 11:13:29 -08:00
Joseph C. Sible
eecd003e2d
Optimize patterns in checkFindNameGlob
...
1. Instead of pattern-matching the same list multiple times, do it only
once and then pass the pieces separately.
2. Don't reconstruct an object equivalent to one we just deconstructed.
2020-02-11 01:04:49 -05:00
Joseph C. Sible
440d0038aa
Remove a partial pattern match equivalent to fromJust from checkFindNameGlob
2020-02-11 01:03:10 -05:00
Vidar Holen
c2d67c15f8
Merge pull request #1802 from szydell/master
...
SC2016, repair false error for M language parser
2020-02-10 18:25:28 -08:00
Vidar Holen
6043deb8f2
Merge pull request #1824 from josephcsible/patch-1
...
Simplify literalEquals
2020-02-10 18:20:05 -08:00
Vidar Holen
d0beac6d0b
Merge pull request #1826 from josephcsible/nofromjust
...
Use the Identity monad to avoid unnecessary uses of fromJust
2020-02-10 18:05:36 -08:00
Vidar Holen
b88b253cad
Merge pull request #1827 from josephcsible/nofromjust2
...
Remove more unnecessary uses of fromJust
2020-02-10 18:01:38 -08:00
Joseph C. Sible
85c49a8af9
Simplify mockedSystemInterface
2020-02-09 23:50:48 -05:00
Joseph C. Sible
42abcb7ae2
Simplify shellFromFilename
2020-02-09 23:18:09 -05:00
Joseph C. Sible
d5c5128115
Use isJust instead of reimplementing it
2020-02-09 23:18:09 -05:00
Joseph C. Sible
6d06103cab
Remove unnecessary uses of head
2020-02-09 23:18:09 -05:00
Joseph C. Sible
c95914f9b3
Simplify determineShell
2020-02-09 23:18:09 -05:00
Joseph C. Sible
ea24e25efd
Use Map.member instead of isJust and Map.lookup
2020-02-09 23:18:09 -05:00
Joseph C. Sible
8f0448133c
Use isNothing instead of reimplementing it
2020-02-09 23:18:08 -05:00
Joseph C. Sible
7fc9496320
Use forM_ instead of reimplementing it
2020-02-09 23:18:08 -05:00
Joseph C. Sible
962fad038c
Avoid a zip that breaks fusion
2020-02-09 23:18:08 -05:00
Joseph C. Sible
a223a7a5a5
Remove unnecessary fromMaybes
2020-02-09 23:18:08 -05:00
Joseph C. Sible
8e9290badb
Do toLower earlier
2020-02-09 23:17:53 -05:00
Joseph C. Sible
292b0840d9
Simplify a double negative
2020-02-09 23:17:53 -05:00
Joseph C. Sible
43c24cf79c
Use Map.! instead of reimplementing it
2020-02-09 23:17:53 -05:00
Joseph C. Sible
21ad4196db
Simplify findFunction
2020-02-09 23:17:53 -05:00
Joseph C. Sible
172aa7c4fc
Avoid unnecessary use of when and unless
2020-02-09 23:17:53 -05:00
Joseph C. Sible
c290eace54
Inline an uncurry
2020-02-09 23:17:53 -05:00
Joseph C. Sible
a6efd02807
Simplify <> for SpaceStatus
2020-02-09 23:17:53 -05:00
Joseph C. Sible
057cc714b3
Simplify matchToken
2020-02-09 23:17:52 -05:00
Joseph C. Sible
0e00249eae
Use void instead of do and return ()
2020-02-09 23:17:52 -05:00
Joseph C. Sible
0ca50159ec
Use head instead of reimplementing it
...
Normally I wouldn't use head, but this code is partial anyway.
2020-02-09 23:17:52 -05:00
Joseph C. Sible
7e6a556ef1
Get rid of potentially
...
This already exists as sequence_.
2020-02-09 23:17:52 -05:00