How do I prevent flycheck from triggering a warning for the following code:
(defun file-path-last-segment ()
"Get last segment of file path for use in snippets."
(-> default-directory
(file-name-directory)
(directory-file-name)
(file-name-nondirectory)))
The following warning appears in my flycheck errors:
the function ‘->’ is not known to be defined.
->
will be a defined function at the place you invoke it. If you too are unsure then just be sure to load (e.g.require
) the library that defines it before you invoke the code that invokes it. (It's just a warning.)