SublimeLinter / SublimeLinter-luacheck

SublimeLinter 3 plugin for lua, using luacheck
MIT License
28 stars 9 forks source link

Handle case were there's no match #14

Closed personalnadir closed 6 years ago

personalnadir commented 7 years ago

It seems that sometimes when something goes wrong with Sublime Linter the match value may be falsey. Looking at linter.py, it checks match and may return it and a lot of None values if the it is not truthy. See: https://github.com/SublimeLinter/SublimeLinter3/blob/master/lint/linter.py

I noticed this issue because match is None if an error occurs earlier in SublimeLinter.

I propose imitating the super function. An alternative would be to check the results of the call to super().split_match and then to just return the results if match or col are None.

Resike commented 6 years ago

I think this issue has something to do with this: https://github.com/mpeterv/luacheck/issues/143

And this fix it only to silently "handle" it.

kaste commented 6 years ago

In SublimeLinter 4, split_match will not be called with None anymore. (For SL3 this was indeed the correct fix, but unfortunately nobody cared at that time. 😞 )