You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The linter fails badly on incomplete control comments #13
I use JSL with Emacs flymake, and when you start writing a control comment and the check is triggered before the comment is complete, the linter exits with a traceback:
File ".../javascriptlint/lint.py", line 73, in _parse_control_comment
keyword = control_comment.lower().split()[0]
IndexError: list index out of range
and thus the flymake-mode gets turned off.
I fixed the issue in my own branch of the tool: since it's under darcs VC, it's not easy for me to provide a git patch, moreover you dropped the test suite so my patch would not apply cleanly.
Anyway, I basically rewrote the _parse_control_comment() in lint.py:
As you can see, I also chose a different way of recognizing the "keyword", since the upstream way of using a split() and checking the presence in a dictionary seemed weak to me, given the existence of "option explicit" that contains a space...
For the curious, my branch can be fetched with
darcs get http://darcs.metapensiero.it/our/lele/javascriptlint
Thanks for the heads-up, and especially the detailed explanation. I don't tend to run into this because I don't check code interactively, but I'd be happy to incorporate these changes if someone else using this branch is hitting the issue. (I may get to it anyway, but I've got a lot on my plate at the moment.)
Activity
davepacheco commentedon Nov 16, 2012
Thanks for the heads-up, and especially the detailed explanation. I don't tend to run into this because I don't check code interactively, but I'd be happy to incorporate these changes if someone else using this branch is hitting the issue. (I may get to it anyway, but I've got a lot on my plate at the moment.)