1

Below is my attempt at adapting "erlang" syntax checker (from flycheck.el) for my needs. It tries to use GNU make for compilation instead of erlc. Apart from that nothing is changed.

(flycheck-define-checker erlang
  "An Erlang syntax checker using the Erlang interpreter.
See URL `http://www.erlang.org/'."
  :command ("make -C " (eval (projectile-project-root)))
  :error-patterns
  ((warning line-start (file-name) ":" line ": Warning:" (message) line-end)
   (error line-start (file-name) ":" line ": " (message) line-end))
  :modes erlang-mode)

Attempt to load it using flycheck-select-checker (C-c ! s) fails with following output:

Syntax checker in buffer test.erl in erlang-mode:

  erlang
    - major mode: `erlang-mode' supported
    - predicate:  nil
    - executable: Not found

Flycheck cannot use this syntax checker for this buffer.

How can I debug this beast?

1

Everything except the command looks fine to me. A command is defined as a list of all arguments/options as items, therefore this should work:

(flycheck-define-checker erlang
  "An Erlang syntax checker using the Erlang interpreter.
See URL `http://www.erlang.org/'."
  :command ("make" "-C" (eval (projectile-project-root)))
  :error-patterns
  ((warning line-start (file-name) ":" line ": Warning:" (message) line-end)
   (error line-start (file-name) ":" line ": " (message) line-end))
  :modes erlang-mode)
  • "error: Invalid command argument (projectile-project-root) in syntax checker erlang". Check (defun flycheck-substitute-argument (arg checker)..). It says that arguments of executable should have one of few defined forms. – Paul Peregud Sep 28 '15 at 20:15
  • Hm, looks like eval means something different in Flycheck command definitions. In that case, I'll undo that change only and leave the other one. – wasamasa Sep 29 '15 at 6:31
  • This fixes the problem of checker loading and can be executed manually with results feeded into other buffer. But it still fails to parse make's output, thus not highlighting any errors in the checked buffer. I'm working on :error-patterns - make outputs some extra lines which contains time in form of hh:mm:ss which may or may not collide with :error-patters matching. – Paul Peregud Sep 29 '15 at 10:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.