mpeterv / luacheck

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

Way to remove certain globals from allowed set #88

Closed daurnimator closed 7 years ago

daurnimator commented 7 years ago

e.g. I would like to be alerted if I use print from a module that shouldn't be doing output (usually a left over debug print)

mpeterv commented 7 years ago

This is like #69 but for "root" global variables only. I'll add not globals option so that not_globals = {"print", "another_global"} works and then extend it once accessing fields of globals is recognized so that not_globals = {"print", "io.stdout"} works to filter fields as well.

mpeterv commented 7 years ago

Implemented on master branch, try not_globals = {"print"} in config or -- luacheck: not globals print inline.