Enable minimal static analysis - #10329
Toucan4Life wants to merge 3 commits into
Conversation
|
Hi @vaisest I was inspired by your PR and want to have full static analysis for the whole project . This PR is to enable it and fix the errors reported by EmmyLua. I have another PR coming soon that will annotate all the file in the classes folder. Do you know how can I get this one merged please? :) |
|
What errors (or warnings) does this fix? Most of these look like fixes for undefined globals which certainly makes sense. It would be a good idea to get rid of any existing errors so that there could be a CI action which checks for really obvious errors I'm not sure how the maintainers feel about putting the emmylua config and types in git. I avoided that myself by just putting examples in CONTRIBUTING.md |
9a59d86 to
2f89a6f
Compare
|
I would prefer to leave it as is to ease the barrier to entry, but I let that decision up to the maintainers. In the meantime I removed it so it is in line with the CONTRIBUTING.md Shamelessly used AI to do this summary : The pre-fix version produced 716 EmmyLua errors. The committed version produced 0 EmmyLua errors. The table below contains the exact diagnostic messages emitted by the checker, grouped when the same message appeared multiple times.
What the commit fixedThe 716 errors fall into these groups:
The fixes were:
|
Description of the problem being solved:
As a newcomer, it was very hard to follow which attribute is available on which type and which function are available. This PR goal is to enable an minimally useful static analysis.
I tried to type some of the module that were dynamically loaded like busted lfs and lzip among others, and tried to fix the most egregious errors that surfaced. To keep the PR small I changed the severity of some classes of errors to warning.
+=syntax andLoadModule/PLoadModuleloading model.A small number of non-annotation changes are included because static analysis exposed some issues :
Steps taken to verify a working solution:
Thanks to this PR, EmmyLua reports 0 errors, and its diagnostics are less noisy