mpeterv / luacheck

A tool for linting and static analysis of Lua code.
MIT License
1.92k stars 321 forks source link

luacheck didn't work as expected #227

Closed vm-001 closed 2 years ago

vm-001 commented 2 years ago

I'm using luacheck 1.0.0.

-- test.lua
local err = "error"
print("a ", err ". ")
$ luacheck test.lua 

Checking test.lua                                 OK

Total: 0 warnings / 0 errors in 1 file
$ lua test.lua

lua: test.lua:2: attempt to call local 'err' (a string value)
stack traceback:
    test.lua:2: in main chunk
    [C]: ?
alerque commented 2 years ago

Two things:

  1. This is not the right repository to report bugs. See #198 for the backstory, then please close this issue and if necessary open a new one from the canonical repository here: https://github.com/lunarmodules/luacheck

  2. Your report doesn't explain what you expected to be different. The issue I see is a type error (you are setting err to a string not a function, then using it as a function). Please be explicit in your report when you open a new issue about what you think should have happened and why it should be a lint error.

Thanks.

vm-001 commented 2 years ago

OK Cool.