4

I switched to a new linter and on big files it causes flycheck to disable because it reports too many errors. I don't believe this is an issue with the linter as when I check the output in the terminal it seems to be legitimate flags. How can I increase the number of errors thrown by the linter before flycheck disables?

1
  • Please, do read the Flycheck manual. These things are documented
    – user227
    Jul 17, 2015 at 8:12

1 Answer 1

8

From Reporting results in the Flycheck manual:

To avoid flooding a buffer with excessive reports, Flycheck discards any reports and disables the corresponding syntax checker subsequently, if the total number of reported errors of any level exceeds the value of flycheck-checker-error-threshold.

And then, from the docstring of this variable:

flycheck-checker-error-threshold is a variable defined in ‘flycheck.el’. Its value is 400

This variable may be risky if used as a file-local variable.

Documentation:

Maximum errors allowed per syntax checker.

The value of this variable is either an integer denoting the maximum number of errors per syntax checker and buffer, or nil to not limit the errors reported from a syntax checker.

If this variable is a number and a syntax checker reports more errors than the value of this variable, its errors are not discarded, and not highlighted in the buffer or available in the error list. The affected syntax checker is also disabled for future syntax checks of the buffer.

Be aware, though, that this limit is there for a reason: An excessive amount of errors renders error navigation and the error list almost useless, and causes a noticeable lag during highlighting and parsing.

Flycheck is really trying to tell you here, that on-the-fly syntax checking doesn't make much sense for files that report over 400 errors.

Speaking as the Flycheck maintainer, I would really recommend you to leave the limit as is, and instead change the configuration of the linter that you use to disable lints that that cause many errors. You can't reasonably handle 400 errors anyway, so there's no use in leaving aggressive linters enabled.

3
  • As an alternative, can one flycheck a selected region? Aug 13, 2015 at 15:14
  • No, you cannot.
    – user227
    Aug 13, 2015 at 15:51
  • 1
    Overriding this value is definitely useful to see what recent configuration change has caused an excessive amount of errors.
    – Bae
    Aug 18, 2016 at 0:34

Your Answer

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

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