Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Commit

Permalink
fix selene lints
Browse files Browse the repository at this point in the history
  • Loading branch information
jackTabsCode committed Dec 21, 2023
1 parent 1c8d329 commit 4e342fb
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 25 deletions.
2 changes: 1 addition & 1 deletion example/src/client/systems/roombasHurt.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ local Components = require(ReplicatedStorage.Shared.components)
local Matter = require(ReplicatedStorage.Lib.Matter)

local function roombasHurt(world)
for id, roomba, model in world:query(Components.Roomba, Components.Model) do
for _, _, model in world:query(Components.Roomba, Components.Model) do
for _, part in Matter.useEvent(model.model.PrimaryPart, "Touched") do
local touchedModel = part:FindFirstAncestorWhichIsA("Model")
if not touchedModel then
Expand Down
2 changes: 1 addition & 1 deletion example/src/client/systems/spinSpinners.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ local function spinSpinners(world, _, ui)

local randomize = ui.button("Randomize colors!"):clicked()

for id, model in world:query(Components.Model, Components.Spinner) do
for _, model in world:query(Components.Model, Components.Spinner) do
model.model.PrimaryPart.CFrame = model.model.PrimaryPart.CFrame * CFrame.Angles(0, math.rad(5), 0)
model.model.PrimaryPart.Transparency = transparency

Expand Down
2 changes: 1 addition & 1 deletion example/src/server/systems/roombasMove.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ local function roombasMove(world)
table.insert(targets, model.model.PrimaryPart.CFrame.p)
end

for id, roomba, charge, model in world:query(Components.Roomba, Components.Charge, Components.Model) do
for _, _, charge, model in world:query(Components.Roomba, Components.Charge, Components.Model) do
if charge.charge <= 0 then
continue
end
Expand Down
4 changes: 2 additions & 2 deletions example/src/server/systems/spawnMotherships.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ local function spawnMotherships(world)
)
end

for id, transform in world:query(Components.Transform, Components.Mothership):without(Components.Model) do
for id in world:query(Components.Transform, Components.Mothership):without(Components.Model) do
local model = ReplicatedStorage.Assets.Mothership:Clone()
model.Parent = workspace
model.PrimaryPart:SetNetworkOwner(nil)
Expand Down Expand Up @@ -57,7 +57,7 @@ local function spawnMotherships(world)
end
end

for id, mothership, model in world:query(Components.Mothership, Components.Model):without(Components.Lasering) do
for _, mothership, model in world:query(Components.Mothership, Components.Model):without(Components.Lasering) do
model.model.Roomba.AlignPosition.Position = mothership.goal
end
end
Expand Down
2 changes: 1 addition & 1 deletion example/src/server/systems/spawnRoombas.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Components = require(ReplicatedStorage.Shared.components)

local function spawnRoombas(world)
for id, transform in world:query(Components.Transform, Components.Roomba):without(Components.Model) do
for id, _ in world:query(Components.Transform, Components.Roomba):without(Components.Model) do
local model = ReplicatedStorage.Assets.KillerRoomba:Clone()
model.Parent = workspace
model.PrimaryPart:SetNetworkOwner(nil)
Expand Down
28 changes: 14 additions & 14 deletions lib/Loop.spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -167,15 +167,15 @@ return function()
it("should throw error for systems with unscheduled depedencies", function()
local loop = Loop.new()

local order = {}
local _order = {}
local systemA = {
system = function()
table.insert(order, "a")
table.insert(_order, "a")
end,
}
local systemB = {
system = function()
table.insert(order, "b")
table.insert(_order, "b")
end,
after = { systemA },
}
Expand All @@ -197,15 +197,15 @@ return function()
it("should throw error for system if dependency is evicted", function()
local loop = Loop.new()

local order = {}
local _order = {}
local systemA = {
system = function()
table.insert(order, "a")
table.insert(_order, "a")
end,
}
local systemB = {
system = function()
table.insert(order, "b")
table.insert(_order, "b")
end,
after = { systemA },
}
Expand All @@ -221,10 +221,10 @@ return function()
it("should throw error for system with empty after table", function()
local loop = Loop.new()

local order = {}
local _order = {}
local systemA = {
system = function()
table.insert(order, "a")
table.insert(_order, "a")
end,
after = {},
}
Expand All @@ -239,22 +239,22 @@ return function()
it("should throw error for systems with cyclic dependency", function()
local loop = Loop.new()

local order = {}
local _order = {}
local systemC = {}
local systemA = {
system = function()
table.insert(order, "a")
table.insert(_order, "a")
end,
after = { systemC },
}
local systemB = {
system = function()
table.insert(order, "b")
table.insert(_order, "b")
end,
after = { systemA, systemC },
}
systemC.system = function()
table.insert(order, "c")
table.insert(_order, "c")
end
systemC.after = { systemA, systemB }

Expand All @@ -270,10 +270,10 @@ return function()
it("should throw error for systems with both after and priority defined", function()
local loop = Loop.new()

local order = {}
local _order = {}
local systemA = {
system = function()
table.insert(order, "a")
table.insert(_order, "a")
end,
priority = 1,
after = {},
Expand Down
1 change: 0 additions & 1 deletion lib/debugger/mouseHighlight.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")

Expand Down
2 changes: 1 addition & 1 deletion lib/debugger/widgets/selectionList.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
return function(Plasma)
local create = Plasma.create

local Item = Plasma.widget(function(text, selected, icon, sideText, width)
local Item = Plasma.widget(function(text, selected, icon, sideText)
local clicked, setClicked = Plasma.useState(false)
local style = Plasma.useStyle()

Expand Down
2 changes: 1 addition & 1 deletion lib/debugger/widgets/worldInspect.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ return function(plasma)

setCache(cache)

for entityId, entityData in world do
for _, entityData in world do
for component in entityData do
cache.uniqueComponents[component] = (cache.uniqueComponents[component] or 0) + 1
end
Expand Down
4 changes: 2 additions & 2 deletions lib/hooks/useEvent.spec.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
local BindableEvent = require(script.Parent.Parent.mock.BindableEvent)
local topoRuntime = require(script.Parent.Parent.topoRuntime)
local useEvent = require(script.Parent.useEvent)
local BindableEvent = require(script.Parent.Parent.mock.BindableEvent)

return function()
describe("useEvent", function()
Expand Down Expand Up @@ -112,7 +112,7 @@ return function()
}

local event = {
connect = function(self, handler)
connect = function(_, handler)
eventHandler = handler

return {
Expand Down
3 changes: 3 additions & 0 deletions selene.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ std = "roblox+testez"

[rules]
shadowing = "allow"

# Plasma's API encourages using mixed tables, so we kind of have to allow it
mixed_table = "allow"

0 comments on commit 4e342fb

Please sign in to comment.