mpeterv / luacheck

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

Global being undefined #202

Closed blasrodri closed 4 years ago

blasrodri commented 4 years ago

First off, thanks for the amazing library @mpeterv!

std = {
globals = {"a", "b"}
}

I'd like this to fail, since we know that b is undefined.

a = 1
value = a * b

Performing the operating would give us somethign like:

stdin:1: attempt to perform arithmetic on a nil value (global 'b')
stack traceback:
    stdin:1: in main chunk
    [C]: in ?
linuxmaniac commented 4 years ago

please read https://github.com/mpeterv/luacheck/issues/198

blasrodri commented 4 years ago

@linuxmaniac Thanks. I'm sorry to read this.