mpeterv / luacheck

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

Possibility to check by known functions signatures #129

Open johnd0e opened 7 years ago

johnd0e commented 7 years ago

And besides of checking predefined std functions it would be even greater if we could specify own functions signatures inline.

mpeterv commented 7 years ago

Do you mean checking types of passed arguments? I would like to avoid having to slowly add parts of type inference to existing luacheck codebase. If there will be type inference it will be implemented in a standalone library. I looked at some type systems for Lua and all seem to be focused on soundness, which is fine but IMO for a linter immediate lack of false positives, without any annotations, is very important. So this has to wait until someone makes a type inference library like that, maybe even me :smile:

If you mean something simpler like checking that number of passed arguments is not higher than expected then it could be added.

johnd0e commented 7 years ago

Well, I mean rather first. But second is good too)