-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add luacheck.sh to automate checking all DFHack scripts. #1
Conversation
Hey, does it produce any useful result for DFHack scripts? I only developed it for Remote scripts and added features I needed there. Also, did you find all types of annotations it supports? |
I'm working on it for this PR: DFHack/dfhack#1295 It's already found a few problems with typo'd variable and function names. |
index.js
Outdated
var m = modules[call.arguments[0].value]; | ||
if (!m) { | ||
m = modules[call.arguments[0].value] = { _type:'table', _module:ctx }; | ||
if (call.arguments[0].value == 'plugins.eventful') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any way not to hardcode all this here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gonna move this to builtins_basic.js
index.js
Outdated
var found = false; | ||
if (base && base._defclass && member) { | ||
for (var p = base; p; p = p._super) { | ||
if (p._type == 'Screen' && (member == 'onShow' || member == 'onDismiss' || member == 'onDestroy' || member == 'onRender' || member == 'onIdle' || member == 'onHelp' || member == 'onGetSelectedUnit' || member == 'onGetSelectedItem' || member == 'onGetSelectedJob' || member == 'onGetSelectedBuilding')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this ideally shouldn't be hardcoded right in process() either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have an anyfunc:none
type that would work for this one, and the others can do similar things. I can also remove the __gui_Painter
type alias.
No description provided.