SublimeLinter/SublimeLinter-luacheck

Error with snippet

Closed this issue · 2 comments

Adding this snippet to a lua file, then restarting Sublime throws an error, and breaks the package:

function AddOn:Hello()
    if true then

    else
        hooksecurefunc(self.frame, "SetPoint", function(frame)
            self:ClearAllPoints()
        end)
    end
end
SublimeLinter: globalfinder activated: c:\users\resike\appdata\roaming\sublime text 3\packages\wowdevelopment\wow global finder\luacheck.exe (disabled in settings) 
SublimeLinter: luacheck activated: c:\users\resike\appdata\roaming\sublime text 3\packages\wowdevelopment\wow global finder\luacheck.exe 
SublimeLinter: error in SublimeLinter daemon: 
SublimeLinter: -------------------- 
SublimeLinter: Traceback (most recent call last):
  File "C:\Users\Resike\AppData\Roaming\Sublime Text 3\Packages\SublimeLinter\lint\queue.py", line 57, in loop
    item = self.q.get(block=True, timeout=self.MIN_DELAY)
  File "./python3.3/queue.py", line 175, in get
queue.Empty

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Resike\AppData\Roaming\Sublime Text 3\Packages\SublimeLinter\lint\queue.py", line 65, in loop
    self.lint(view_id, timestamp)
  File "C:\Users\Resike\AppData\Roaming\Sublime Text 3\Packages\SublimeLinter\lint\queue.py", line 111, in lint
    self.callback(view_id, timestamp)
  File "C:\Users\Resike\AppData\Roaming\Sublime Text 3\Packages\SublimeLinter\sublimelinter.py", line 121, in lint
    Linter.lint_view(view, filename, code, hit_time, callback)
  File "C:\Users\Resike\AppData\Roaming\Sublime Text 3\Packages\SublimeLinter\lint\linter.py", line 968, in lint_view
    linter.lint(hit_time)
  File "C:\Users\Resike\AppData\Roaming\Sublime Text 3\Packages\SublimeLinter\lint\linter.py", line 1449, in lint
    for match, line, col, error, warning, message, near in self.find_errors(output):
  File "C:\Users\Resike\AppData\Roaming\Sublime Text 3\Packages\SublimeLinter\lint\linter.py", line 1792, in find_errors
    yield self.split_match(self.regex.match(line.rstrip()))
  File "linter in C:\Users\Resike\AppData\Roaming\Sublime Text 3\Installed Packages\SublimeLinter-luacheck.sublime-package", line 35, in split_match
AttributeError: 'NoneType' object has no attribute 'group'

Modifying the snippet like this and it's working fine again:

function AddOn:Hello()
    local x = true
    if x then

    else
        hooksecurefunc(self.frame, "SetPoint", function(frame)
            self:ClearAllPoints()
        end)
    end
end

I think it's gonna be luacheck's fault.