Fix linting
Use .styluaignore instead of Makefile hacks to ignore generated files.
This commit is contained in:
parent
4d69e77d9f
commit
90fa692303
|
@ -0,0 +1 @@
|
||||||
|
src/assets.lua
|
5
Makefile
5
Makefile
|
@ -1,5 +1,4 @@
|
||||||
SOURCE_FILES := $(shell grep "import '" src/main.lua | grep -v CoreLibs | sed "s/.*'\(.*\)'.*/src\/\1/") src/main.lua
|
SOURCE_FILES := $(shell grep "import '" src/main.lua | grep -v CoreLibs | sed "s/.*'\(.*\)'.*/src\/\1/") src/main.lua
|
||||||
GENERATED_FILES := src/assets.lua
|
|
||||||
|
|
||||||
all:
|
all:
|
||||||
pdc --skip-unknown src BatterUp.pdx
|
pdc --skip-unknown src BatterUp.pdx
|
||||||
|
@ -8,11 +7,11 @@ assets:
|
||||||
lua lib/preprocess-cl.lua src/assets.lua2p
|
lua lib/preprocess-cl.lua src/assets.lua2p
|
||||||
|
|
||||||
check: assets
|
check: assets
|
||||||
stylua -c --indent-type Spaces -g "*.lua" -g "!${GENERATEED_FILES}" src/
|
stylua -c --indent-type Spaces src/
|
||||||
cat __stub.ext.lua <(sed 's/^function/-- selene: allow(unused_variable)\nfunction/' ${PLAYDATE_SDK_PATH}/CoreLibs/__types.lua) ${SOURCE_FILES} | grep -v '^import' | sed 's/<const>//g' | selene -
|
cat __stub.ext.lua <(sed 's/^function/-- selene: allow(unused_variable)\nfunction/' ${PLAYDATE_SDK_PATH}/CoreLibs/__types.lua) ${SOURCE_FILES} | grep -v '^import' | sed 's/<const>//g' | selene -
|
||||||
|
|
||||||
test: check
|
test: check
|
||||||
(cd src; find ./test -name '*lua' | xargs -L1 lua)
|
(cd src; find ./test -name '*lua' | xargs -L1 lua)
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
stylua --indent-type Spaces -g "*.lua" -g "!${GENERATEED_FILES}" src/
|
stylua --indent-type Spaces src/
|
||||||
|
|
|
@ -41,11 +41,8 @@ function actionQueue:runWaiting(deltaSeconds)
|
||||||
local currentTimeMs = playdate.getCurrentTimeMilliseconds()
|
local currentTimeMs = playdate.getCurrentTimeMilliseconds()
|
||||||
for name, actionObject in pairs(self.queue) do
|
for name, actionObject in pairs(self.queue) do
|
||||||
local result = actionObject.action(deltaSeconds)
|
local result = actionObject.action(deltaSeconds)
|
||||||
if
|
if result ~= ActionResult.NeedsMoreTime or currentTimeMs > actionObject.expireTimeMs then
|
||||||
result ~= ActionResult.NeedsMoreTime
|
|
||||||
or currentTimeMs > actionObject.expireTimeMs
|
|
||||||
then
|
|
||||||
self.queue[name] = nil
|
self.queue[name] = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -59,4 +59,3 @@ function Ball:launch(destX, destY, easingFunc, flyTimeMs, floaty, customBallScal
|
||||||
self.floatAnimator:reset(flyTimeMs)
|
self.floatAnimator:reset(flyTimeMs)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ function Baserunning.new(announcer)
|
||||||
--- Since this object is what ultimately *mutates* the out count,
|
--- Since this object is what ultimately *mutates* the out count,
|
||||||
--- it seems sensible to store the value here.
|
--- it seems sensible to store the value here.
|
||||||
outs = 0,
|
outs = 0,
|
||||||
announcer = announcer
|
announcer = announcer,
|
||||||
}, { __index = Baserunning })
|
}, { __index = Baserunning })
|
||||||
|
|
||||||
o.batter = o:newRunner()
|
o.batter = o:newRunner()
|
||||||
|
|
|
@ -28,12 +28,7 @@ function drawMinimap(runners, fielders)
|
||||||
for _, fielder in pairs(fielders) do
|
for _, fielder in pairs(fielders) do
|
||||||
local x = (MinimapMultX * fielder.x) + MinimapOffsetX
|
local x = (MinimapMultX * fielder.x) + MinimapOffsetX
|
||||||
local y = (MinimapMultY * fielder.y) + MinimapOffsetY
|
local y = (MinimapMultY * fielder.y) + MinimapOffsetY
|
||||||
if
|
if x > MinimapPosX and x < MinimapBoundX and y > MinimapPosY and y < MinimapBoundY then
|
||||||
x > MinimapPosX
|
|
||||||
and x < MinimapBoundX
|
|
||||||
and y > MinimapPosY
|
|
||||||
and y < MinimapBoundY
|
|
||||||
then
|
|
||||||
gfx.drawCircleAtPoint(x, y, FielderCircleRadius)
|
gfx.drawCircleAtPoint(x, y, FielderCircleRadius)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -144,7 +144,7 @@ end
|
||||||
---@param throwFlyMs number
|
---@param throwFlyMs number
|
||||||
function Fielding:playerThrowTo(targetBase, launchBall, throwFlyMs)
|
function Fielding:playerThrowTo(targetBase, launchBall, throwFlyMs)
|
||||||
local maxTryTimeMs = 5000
|
local maxTryTimeMs = 5000
|
||||||
actionQueue:upsert('playerThrowTo', maxTryTimeMs, function()
|
actionQueue:upsert("playerThrowTo", maxTryTimeMs, function()
|
||||||
return playerThrowToImpl(self, targetBase, launchBall, throwFlyMs)
|
return playerThrowToImpl(self, targetBase, launchBall, throwFlyMs)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
|
@ -200,7 +200,6 @@ local function outRunner(runner, message)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
---@param scoredRunCount number
|
---@param scoredRunCount number
|
||||||
|
|
|
@ -31,7 +31,7 @@ function utils.staticAnimator(value)
|
||||||
currentValue = function(_)
|
currentValue = function(_)
|
||||||
return value
|
return value
|
||||||
end,
|
end,
|
||||||
reset = function(_) end
|
reset = function(_) end,
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue