--check is now --lint
This commit is contained in:
parent
664ba9b13d
commit
d8bfaa3559
@ -3,7 +3,7 @@
|
|||||||
(local json-rpc (require :fennel-ls.json-rpc))
|
(local json-rpc (require :fennel-ls.json-rpc))
|
||||||
|
|
||||||
(λ check [filenames]
|
(λ check [filenames]
|
||||||
"non-interactive mode that gets executed from CLI with --check.
|
"non-interactive mode that gets executed from CLI with --lint.
|
||||||
runs lints on each file, then formats and prints them"
|
runs lints on each file, then formats and prints them"
|
||||||
(local files (require :fennel-ls.files))
|
(local files (require :fennel-ls.files))
|
||||||
(local lint (require :fennel-ls.lint))
|
(local lint (require :fennel-ls.lint))
|
||||||
@ -38,10 +38,10 @@
|
|||||||
|
|
||||||
(λ main []
|
(λ main []
|
||||||
(case arg
|
(case arg
|
||||||
["--check" & filenames] (check filenames)
|
["--lint" & filenames] (check filenames)
|
||||||
(where (or ["--server"] [nil])) (main-loop (io.input)
|
(where (or ["--server"] [nil])) (main-loop (io.input)
|
||||||
(io.output))
|
(io.output))
|
||||||
_args (do (io.stderr:write "USAGE: fennel-ls [--check file] [--server]\n")
|
_args (do (io.stderr:write "USAGE: fennel-ls [--lint file] [--server]\n")
|
||||||
(os.exit 1))))
|
(os.exit 1))))
|
||||||
|
|
||||||
(main)
|
(main)
|
||||||
|
|||||||
@ -7,11 +7,11 @@
|
|||||||
(doto (io.open input-file-name :w)
|
(doto (io.open input-file-name :w)
|
||||||
(: :write "(local x 1)")
|
(: :write "(local x 1)")
|
||||||
(: :close))
|
(: :close))
|
||||||
(let [output-file (io.popen (.. "./fennel-ls --check "
|
(let [output-file (io.popen (.. "./fennel-ls --lint "
|
||||||
input-file-name)
|
input-file-name)
|
||||||
:r)]
|
:r)]
|
||||||
(faith.= (.. input-file-name ":1:7: unused definition: x\n")
|
(faith.= (.. input-file-name ":1:7: unused definition: x\n")
|
||||||
(output-file:read :*a) )
|
(output-file:read :*a))
|
||||||
(os.remove input-file-name))
|
(os.remove input-file-name))
|
||||||
nil))
|
nil))
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user