You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running luacheck on a lua file attached to an interface object, luacheck doesn't know what the parent template of the file is (so it doesn't know about the functions whitelisted in that template). Since this is not a function of my parser script, but rather of luacheck, I would have to fork luacheck iteself to add some feature for scope detection (which would be FG specific) if I wanted to actually 'fix' this.
One easier option is to add all functions to a global definition table which would resolve those errors. The downside is that luacheckrc would not know if you're calling a function that doesn't exist in that interface object. For example, using "setComboBoxReadOnly" would not show an error if used in a script that was attached to a numbercontrol. Effectively it would be whitelisting all functions of all interface objects for use in all interface scripts.
Another option is to add per-file definitions via a lua comment such as "-- luacheck: globals getName" which would allow use of that function in the file. This is a significant task for each developer, but would preserve much more linting functionality.
The text was updated successfully, but these errors were encountered:
It would require generating a luacheck file for each project it's used in (something I was already considering that could be a big improvement for execution speed and flexibility).
Parse project to create an array linking script filenames to their interface object names.
Run current parsing logic on the inherited dataset (such as CoreRPG and Moon Tracker extension).
Use inherited dataset to add per-file whitelists for any files found in project.
The downside is that you would have to re-run this program on the project directory whenever you created a new file.
When running luacheck on a lua file attached to an interface object, luacheck doesn't know what the parent template of the file is (so it doesn't know about the functions whitelisted in that template). Since this is not a function of my parser script, but rather of luacheck, I would have to fork luacheck iteself to add some feature for scope detection (which would be FG specific) if I wanted to actually 'fix' this.
One easier option is to add all functions to a global definition table which would resolve those errors. The downside is that luacheckrc would not know if you're calling a function that doesn't exist in that interface object. For example, using "setComboBoxReadOnly" would not show an error if used in a script that was attached to a numbercontrol. Effectively it would be whitelisting all functions of all interface objects for use in all interface scripts.
Another option is to add per-file definitions via a lua comment such as "-- luacheck: globals getName" which would allow use of that function in the file. This is a significant task for each developer, but would preserve much more linting functionality.
The text was updated successfully, but these errors were encountered: