radian-software / straight.el

🍀 Next-generation, purely functional package manager for the Emacs hacker.
MIT License
2.68k stars 151 forks source link

straight-fix-flycheck breaks chained checkers #938

Open Deewiant opened 2 years ago

Deewiant commented 2 years ago

(This is more of an FYI than a proper bug report, apologies but I don't have the time to distill this into something reproducible and I'm not very invested since leaving straight-fix-flycheck disabled is fine by me.)

After enabling straight-fix-flycheck I ran into some unexpected issues: With some projects / file types, flycheck would get stuck in "running" state i.e. the modeline would show FlyC* instead of the number of diagnostics. Modifying the buffer didn't fix this but writing to the file did.

I suspect this is because just disabling flycheck-start-current-syntax-check like the current workaround does breaks the logic here: https://github.com/flycheck/flycheck/blob/55f25fd98abc145c0c464756504132c271f0f039/flycheck.el#L3280-L3295

I.e. in the case that you have a 'source-inplace checker chained after a non-'source-inplace checker and flycheck wants to start running the later checker, this workaround kicks in, preventing all those "cleanups" in flycheck-finish-current-syntax-check from occurring for the non-'source-inplace checker and generally leaving flycheck in an inconsistent state.

The workaround should probably only be enabled in emacs-lisp-mode to mitigate this, but even then it's up to each individual's flycheck setup (or future changes in flycheck's default setup for elisp) whether they'll hit this problem or not.

progfolio commented 2 years ago

Thank you for the detailed analysis. I will look into this soon.