so core.match has a weird syntax for matching on function values that basically looks like
(matched-value :<< fn-to-apply)
which in practice looks like:
(true :<< empty?)
and unfortunately joker complains that true isn’t a function
as far as I can tell there doesn’t seem to be a way to tell joker to ignore that case
any body have any advice?
besides opening a pull request haha
I am assuming (true :<< empty?)
is inside some sort of macro?
(sorry, not familiar with core.match)
yeah its within the core.match/match macro
which i added to the known macros list
and that fixed a few of the errors
but whatever the linter rule is for ‘true is not a function’ doesn’t care about the known macros list
right, macros are extremely problematic for linters. They only way to fix the issue would be to "teach" joker that core.match/match macro (or a simplified version of it), so that it expands the body into something that can be linted. There is a way to provide Joker with additional definitions (including macros). See this comment: https://github.com/candid82/joker/issues/52#issuecomment-385142109 It may or may not be practical for core.match/match as I suppose that macro is quite complex.
ok thanks i’ll look into that
seems like i could use that approach to just make it not lint the body of the match macro
which is a fine solution for me
yep, you can always expand to empty body, which will effectively remove the body before linting pass
ok yeah that works. it also means that i have to add some more ignored unused namespaces since they are used in the macro body but thats ok
if i had more time i’d use this as an excuse to learn some go
haha