bahrmichael / factorio-tycoon

GNU General Public License v3.0
10 stars 7 forks source link

chore: add luacheck workflow for PRs #305

Closed bahrmichael closed 8 months ago

bahrmichael commented 8 months ago

Introduces static code analysis for lua files. Should prevent problems like https://github.com/bahrmichael/factorio-tycoon/commit/4579b5de58fa6cb04374a20d2a50cc914a132813.

winex commented 8 months ago

yeah, that's cool. i tried same thing after my pr-1, but didn't return to it. i used Nexela's .luacheckrc, you may check my winex:test branch https://github.com/bahrmichael/factorio-tycoon/compare/0.4.1...winex:factorio-tycoon:test if it has anything useful

badge looks cool, btw :)

winex commented 8 months ago
prototypes/entities/hidden-light.lua:3:23: accessing undefined field deepcopy of global table

this is how factorio std's was added by Nexela: https://github.com/Nexela/Factorio-luacheckrc/tree/master/.luacheckrc#L338-L349

bahrmichael commented 8 months ago

yeah, that's cool. i tried same thing after my pr-1, but didn't return to it. i used Nexela's .luacheckrc, you may check my winex:test branch 0.4.1...winex:factorio-tycoon:test if it has anything useful

badge looks cool, btw :)

Thanks! I took a look, but prefer to stick with an actions and .rc file for now. I'll make the luacheck more strict over time, but want to wait until your big changes are in.

bahrmichael commented 8 months ago

https://github.com/Nexela/Factorio-luacheckrc/tree/master/.luacheckrc#L338-L349

Nice! I added that in https://github.com/bahrmichael/factorio-tycoon/commit/fc973f06151de9d1b805fbc775f523d07cb975ab

winex commented 8 months ago

serpent is provided by Factorio, too...

bahrmichael commented 8 months ago

Let's add that when we use it :) checks were green so i expected there to be no current issues