~technomancy/pengbot

1f14befd831d0fc1fd0507c4175d4910c5c75a6e — Phil Hagelberg 10 months ago e7d0694
Add check make target; address most linting concerns.

The linter still doesn't like certain case nil checks, because it
can't tell that they are in fact being used.
5 files changed, 8 insertions(+), 6 deletions(-)

M fennels.fnl
M handlers.fnl
M irc.fnl
M main.fnl
M makefile
M fennels.fnl => fennels.fnl +1 -1
@@ 1,4 1,4 @@
(local {: view &as fennel} (require :fennel))
(local {: view} (require :fennel))
(local unpack (or table.unpack _G.unpack))

(local versions {})

M handlers.fnl => handlers.fnl +1 -1
@@ 36,7 36,7 @@
        ;; one day
        (jam-date date (+ time (* 60 60 24))))))

(fn jam [a b {: caps}]
(fn jam [_ _ {: caps}]
  (.. "The next lisp game jam starts on "
      (jam-date caps.os.date (caps.os.time)) "."))


M irc.fnl => irc.fnl +2 -2
@@ 43,7 43,7 @@

;; commands are like protocol-level handlers, whereas the handlers
;; module is for application-level handlers.
(fn irc.commands.ping [conn prefix rest] (irc.pong conn rest))
(fn irc.commands.ping [conn _prefix rest] (irc.pong conn rest))

(fn comma-input? [conn chan msg]
  (and (msg:find "^,") (= chan (. conn.channels 1))))


@@ 74,7 74,7 @@
                        (irc.privmsg conn chan (.. "Error: " err)))))))

;; after you've identified and are properly connected
(fn join-handler [conn prefix rest]
(fn join-handler [conn _prefix _rest]
  (print "Connected!")
  (each [_ channel (ipairs conn.channels)]
    (let [channel (if (channel:find "^#")

M main.fnl => main.fnl +0 -1
@@ 30,7 30,6 @@
;; versions!

(local arg arg)
(local setfenv _G.setfenv)
(local old-preload (collect [k (pairs package.preload)] (values k true)))
(local _ENV (capabilities.env))
(include :pengbot)

M makefile => makefile +4 -1
@@ 50,4 50,7 @@ clean:
	make -C luasocket clean
	make -C lua-$(LUA_VERSION) clean

.PHONY: run update-fennel clean
check:
	fennel-ls --check $(SRC)

.PHONY: run update-fennel clean check