I'd like the
:command of a flycheck checker to depend on the file extension of the input.
.texfiles run the command
foo --format latex file.tex
- for any other file extension run the command
foo --format text file.txt
:command ("foo" "--format"
`(if (string= "tex" (file-name-extension source-inplace))
flycheck-define-command-checker: Invalid command argument (\‘ (if (string= "tex" (file-name-extension source-inplace)) "latex" "text")) in syntax checker textlint
Is it possible to achieve what I'm attempting? i.e the command string passed to
:command being determined by the file extension of the file being checked by flycheck?
For context, the solution was required for implementing a textlint flycheck checker: https://www.macs.hw.ac.uk/~rs46/posts/2018-12-29-textlint-flycheck.html