New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stop after first N error messages #166
Comments
Hmm, weird. Why would it hang your terminal? I've had that happened before to and simple did Ctrl+C. |
Control+C did not work :( Might have been because it was running through NPM instead of directly? |
I think this is a nice idea. But I'd increase the N to something way bigger (like 300?), so that behavior kicks in less often. When N is >= 300, we stop the linter (not sure if that's possible though), print errors and show some message telling that there are more errors. |
An option idea, closing this issue:
If this option seems like a good idea, I can start working on it. |
@sindresorhus Would love to hear your opinion on the idea above ^^ 😄 |
Sounds ok. I don't see any point in having a way to set the limit. I would make it have a limit of 1000 by default (so it won't affect normal usage) and add a |
To solve the situation described above where too many errors are printed in the output, should one just use Ctrl+C to stop the process? There is cases where you want to output all the errors, like when XO run on a CI (so you want to look at the logs afterward) and you have a lot of legacy linting errors that you are progressively fixing. |
@pvdlg Not so simple. If the program has already outputted its text, Ctrl+C does nothing until the terminal emulator catches up. That's what most people face when seeing this class of problem. This is why you want to limit the source of the errors. @sindresorhus another alternative is to check |
So. Made the mistake of including a few of Stack Overflow's generated Javascript files in a repository for a few tests (long story, yes they belong there) but forgot XO recurses into directories (as it should!).
However, the result was... well, terrifying. It locked up my terminal and just puked error messages.
Just like with Clang, we should stop after N error messages (like.. idk, 100?) or else I could have let this go on for hours (okay, maybe tens of minutes) with no control (ultimately had to open up another terminal and kill xo manually).
The text was updated successfully, but these errors were encountered: