(and) and (or) are covered by unpack diagnostic
This commit is contained in:
parent
a973de5f87
commit
a3dcd92e85
@ -52,7 +52,7 @@ the `file.diagnostics` field, filling it with diagnostics."
|
|||||||
:code 303
|
:code 303
|
||||||
:codeDescription "unnecessary-method"}))))
|
:codeDescription "unnecessary-method"}))))
|
||||||
|
|
||||||
(local ops {"+" 1 "-" 1 "*" 1 "/" 1 "//" 1 "%" 1 ".." 1})
|
(local ops {"+" 1 "-" 1 "*" 1 "/" 1 "//" 1 "%" 1 ".." 1 "and" 1 "or" 1})
|
||||||
(λ bad-unpack [self file]
|
(λ bad-unpack [self file]
|
||||||
"an unpack call leading into an operator"
|
"an unpack call leading into an operator"
|
||||||
(icollect [[op &as call] (pairs file.calls)
|
(icollect [[op &as call] (pairs file.calls)
|
||||||
@ -72,7 +72,7 @@ the `file.diagnostics` field, filling it with diagnostics."
|
|||||||
(if (fennel.sym? op "..")
|
(if (fennel.sym? op "..")
|
||||||
(let [unpackme (fennel.view (. call (length call) 2))]
|
(let [unpackme (fennel.view (. call (length call) 2))]
|
||||||
(.. " Use (table.concat " unpackme ") instead of (.. (unpack " unpackme "))"))
|
(.. " Use (table.concat " unpackme ") instead of (.. (unpack " unpackme "))"))
|
||||||
(.. " Use a loop when you have a dynamic number of arguments to " (tostring op))))
|
(.. " Use a loop when you have a dynamic number of arguments to (" (tostring op) ")")))
|
||||||
:severity message.severity.WARN
|
:severity message.severity.WARN
|
||||||
:code 304
|
:code 304
|
||||||
:codeDescription "bad-unpack"}))))
|
:codeDescription "bad-unpack"}))))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user