I just wrote the following checker for syntax-checking Vala code using
(flycheck-def-option-var flycheck-vala-packages nil vala-valac "A list of additional pakages for valac. The value of this variable is a list of strings, where each string is what would get passed to valac's --pkg option." :type '(repeat (file :tag "Include package")) :safe #'flycheck-string-list-p :package-version '(flycheck . "0.20")) (flycheck-def-option-var flycheck-vala-enable-experimental-non-null nil vala-valac "Whether to enable strict non-null checking for valac. When non-nil, enable strict null checks as by --enable-experimental-non-null." :type 'boolean :safe #'booleanp :package-version '(flycheck . "0.20")) (flycheck-define-checker vala-valac "A Vala syntax checker using valac." :command ("valac" "-c -o" null-device (option-flag "--enable-experimental-non-null" flycheck-vala-enable-experimental-non-null) (option-list "--pkg" flycheck-vala-packages) source) :error-patterns ((error line-start (file-name) ":" line "." column "-" line "." column ": error" (message) line-end) (warning line-start (file-name) ":" line "." column "-" line "." column ": warning: " (message) line-end)) :modes vala-mode) (add-to-list 'flycheck-checkers 'vala-valac)
However, when I try to use it, I get the following two errors; the first on loading my init file:
Symbol's function definition is void: flycheck-checker-get
And this one when I try to use the checker on a Vala file:
Suspicious state from syntax checker vala-valac: Checker vala-valac returned non-zero exit code 1, but no errors from output: Unknown option -c -o Run '/usr/bin/valac --help' to see a full list of available command line options. Checker definition probably flawed.
I'm not sure about why this is happening, especially the first one. The second error is clearly due to argument order, but according to the
valac manpage, both
-o are valid flags.