-
Notifications
You must be signed in to change notification settings - Fork 178
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
Linting breaks when using multiple linters on same file #139
Comments
Reading the code to Given that, it seems like the real fix should be to prevent whatever is causing |
No I don't know why it's been called twice. If you look at |
I didn't write the original code so I don't know for certain, but I'm pretty sure. Reading the implementation, how do you think it's being called twice? It seems to me that's only possible if If you have a solid repro you might be able to investigate by putting a console.trace() line to see what's triggering it. |
Alright, I can't answer that right away, I'll try to create a repro and get back to you. |
Thanks for spending time on this @IjzerenHein 👍 |
Fix for multiple linters on the same file (#139)
Yeah, multiple linters in the same file works fine for me too. Still, there could be some kind of race condition causing this bug for other people. What I wanted to ask you though @hd-deman is if |
the answer is no, it must called olny once per linter instantiation. so waiting for @IjzerenHein digging. I also digging deeper |
Cool. We can keep this issue open then. Maybe as a followup to #167 we should have the linter emit a warning if it detects that |
If |
Oh and if it's working on your system, that doesn't necessarily mean there is no bug there. If the linter already has a handle open to the file, then |
@hd-deman & @IjzerenHein: Take a look at a462f36, I think that's what the issue was. |
Yeah that looks like a great explanation & solution, excellent work @dmnd! |
👍 tnx |
Hi, I've been debugging as issue regarding
linter-jscs
, and came across a problem in either the corelinter
-code orlinter-jscs
. I can't figure out how the code was intended to work, so I'm reporting it here.The situation is that
linter-jscs
is callingLinterView.processMessage
twice. This in turn causes the temporary file to be deleted before other linters are done processing it.Linter.processMessage
:Now, looking the code, it wasn't clear to me at all, whether
processMessage
was allowed to run multiple times? Based on the nameprocessMessage
I would expect that it can be called multiple times, e.g. for every message that is outputted. However, looking at the implementation, it seems that it decreases thecompletedLinters
counter for every-call. This seems like a bug to me, either inLinterView.processMessage
or in `linter-jscs'.The consequence is that the first linter seemingly works correctly. Even if it would call
processMessage
twice, the file would be in-use and can therefore not be unlinked. But this will cause the temporary file to not be cleaned up in the temp-directory. The second linter will experience problems like 'Cannot find file...',A dime for your thoughts.
The text was updated successfully, but these errors were encountered: