mirror of
https://github.com/koalaman/shellcheck
synced 2025-08-19 13:00:54 -07:00
Add deprecation warning for tempfile
This commit is contained in:
parent
a40efffec9
commit
cf1c46d852
1 changed files with 6 additions and 0 deletions
|
@ -82,6 +82,7 @@ commandChecks = [
|
||||||
,checkTimeParameters
|
,checkTimeParameters
|
||||||
,checkTimedCommand
|
,checkTimedCommand
|
||||||
,checkLocalScope
|
,checkLocalScope
|
||||||
|
,checkDeprecatedTempfile
|
||||||
]
|
]
|
||||||
|
|
||||||
buildCommandMap :: [CommandCheck] -> Map.Map CommandName (Token -> Analysis)
|
buildCommandMap :: [CommandCheck] -> Map.Map CommandName (Token -> Analysis)
|
||||||
|
@ -659,5 +660,10 @@ checkLocalScope = CommandCheck (Exactly "local") $ \t ->
|
||||||
unless (any isFunction path) $
|
unless (any isFunction path) $
|
||||||
err (getId t) 2168 "'local' is only valid in functions."
|
err (getId t) 2168 "'local' is only valid in functions."
|
||||||
|
|
||||||
|
prop_checkDeprecatedTempfile1 = verify checkDeprecatedTempfile "var=$(tempfile)"
|
||||||
|
prop_checkDeprecatedTempfile2 = verifyNot checkDeprecatedTempfile "tempfile=$(mktemp)"
|
||||||
|
checkDeprecatedTempfile = CommandCheck (Basename "tempfile") $
|
||||||
|
\t -> warn (getId t) 2186 "tempfile is deprecated. Use mktemp instead."
|
||||||
|
|
||||||
return []
|
return []
|
||||||
runTests = $( [| $(forAllProperties) (quickCheckWithResult (stdArgs { maxSuccess = 1 }) ) |])
|
runTests = $( [| $(forAllProperties) (quickCheckWithResult (stdArgs { maxSuccess = 1 }) ) |])
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue