This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-03-07
Channels
- # announcements (1)
- # architecture (9)
- # babashka (3)
- # calva (10)
- # clj-http (13)
- # clj-kondo (11)
- # clojure (23)
- # clojure-europe (11)
- # clojure-nl (1)
- # clojure-norway (112)
- # clojure-uk (4)
- # clojuredesign-podcast (8)
- # clojurescript (10)
- # core-async (5)
- # cursive (7)
- # data-science (15)
- # datascript (2)
- # datomic (29)
- # emacs (5)
- # events (1)
- # hugsql (1)
- # hyperfiddle (9)
- # midje (1)
- # missionary (3)
- # music (1)
- # off-topic (34)
- # polylith (1)
- # re-frame (16)
- # shadow-cljs (117)
- # squint (19)
- # yamlscript (1)
Hi, I've added in the .clj-kondo/config.edn following lines to the map:
:linters
{:unresolved-symbol
{:exclude [(portfolio.reagent-18/defscene)
(automaton-web.portfolio.proxy/defdisplay)]}}
So that portfolio (library) custom macros functions won't give clj-kondo warnings.
Which causes .clj-kondo to add directory, and file:
.clj-kondo/no.cjohansen/portfolio/config.edn
Which is empty and gives a warning from clj-kondo.
Adding empty map there, makes condo overwrite it with empty file.In some cases I use the template method pattern as seen on https://mishadoff.com/blog/clojure-design-patterns/#episode-5-template-method. I know it probably is not feasible but here goes: Could clj-kondo help in identifying, for instance, if a template method provided has the wrong arity? For example:
(defn mage-handle-chest [chest]
;; implementation
)
(defn mage-attack [enemies some-other-param]
;; implementation
(defn move-to [character location
& {:keys [handle-chest attack]}
;; implementation calling the template methods `handle-chest` and `attack`
;; `attack` will be called with one argument, can clj-kondo identify that at a calling site the `attack` fn passed, is a 2 argument function?
^^^^^^^^^^^^^
)
;; Calling site
(move-to character location
:handle-chest mage-handle-chest
;; `mage-attack` requires 2 arguments to be passed, but `move-to` will call it with 1
^^^^^^^^^^^^^^^^^^^^
:attack mage-attack)