Skip to content
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

Merged
merged 9 commits into from
Jun 25, 2018

Conversation

BenLubar
Copy link
Contributor

@BenLubar BenLubar commented Jun 3, 2018

No description provided.

@pronvit
Copy link
Contributor

pronvit commented Jun 4, 2018

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?

@BenLubar
Copy link
Contributor Author

BenLubar commented Jun 5, 2018

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') {
Copy link
Contributor

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?

Copy link
Contributor Author

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')) {
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@pronvit pronvit merged commit aef47d6 into mifki:master Jun 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants