I have a flake8 wrapper script: a small program that execs flake8 (in order to pick an appropriate version of flake8 for whichever project I'm working on). flycheck is using that wrapper script (I'm sure of that because I can break syntax checking in emacs by editing the script).

I have verified that if I change the source code of the wrapper script in a certain way, such as to leave its stdout, stderr and exit code unchanged, flycheck's behaviour nevertheless changes!

In particular it seems that with one source code text for my wrapper script, flycheck shows both errors (red squiggly line under offending lines) and warnings (yellow squiggly line) -- and with the other source code text, it displays only warnings.

It seems perhaps emacs is actually looking at the text of the wrapper script itself in order to guess something?

Perhaps even more oddly, I've reproduced the same issue using both a wrapper script implemented in python, and one implemented in sh -- so the source code in each case is rather different!

This is a pretty crazy issue, anybody have any guesses, or hints on start debugging flycheck?

All help appreciated!

1 Answer 1


Turns out the answer is that I was running my script differently than emacs was: emacs was piping stdin into flake8, but I was passing it a filename directly.

Since I was using the pathname in my wrapper script to determine which flake8 to run, the wrapper script behaved differently if I left that check in or disabled it.

(I thought I'd verified it was reaching the right code branch, but I only verified that using a command that emacs was not using!)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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