added Luacheck GitHub action (#210)

* added shields.io elements
* #209 luacheck action
* #209 cleanup to pass luacheck
* added check statuses to readme
This commit is contained in:
Mikayla
2023-04-12 16:02:29 -04:00
committed by GitHub
parent 3ae39b2455
commit c987d14d8d
35 changed files with 93 additions and 114 deletions

View File

@@ -68,11 +68,6 @@ function plc.rps_init(reactor, is_formed, emer_cool)
end
end
-- clear reactor access fault flag
local function _clear_fault()
self.state[state_keys.fault] = false
end
-- set emergency coolant control (if configured)
---@param state boolean true to enable emergency coolant, false to disable
local function _set_emer_cool(state)
@@ -779,7 +774,6 @@ function plc.comms(id, version, modem, local_port, server_port, range, reactor,
---@param setpoints setpoints setpoint control table
function public.handle_packet(packet, plc_state, setpoints)
-- print a log message to the terminal as long as the UI isn't running
local function println(message) if not plc_state.fp_ok then util.println(message) end end
local function println_ts(message) if not plc_state.fp_ok then util.println_ts(message) end end
-- handle packets now that we have prints setup

View File

@@ -20,9 +20,7 @@ local threads = require("reactor-plc.threads")
local R_PLC_VERSION = "v1.1.5"
local print = util.print
local println = util.println
local print_ts = util.print_ts
local println_ts = util.println_ts
----------------------------------------
@@ -176,8 +174,9 @@ local function main()
-- front panel time!
if not renderer.ui_ready() then
local message = nil
local message
plc_state.fp_ok, message = pcall(renderer.start_ui)
if not plc_state.fp_ok then
renderer.close_ui()
println_ts(util.c("UI error: ", message))

View File

@@ -34,7 +34,6 @@ local MQ__COMM_CMD = {
---@param init function
function threads.thread__main(smem, init)
-- print a log message to the terminal as long as the UI isn't running
local function println(message) if not smem.plc_state.fp_ok then util.println(message) end end
local function println_ts(message) if not smem.plc_state.fp_ok then util.println_ts(message) end end
---@class parallel_thread
@@ -307,7 +306,6 @@ end
---@param smem plc_shared_memory
function threads.thread__rps(smem)
-- print a log message to the terminal as long as the UI isn't running
local function println(message) if not smem.plc_state.fp_ok then util.println(message) end end
local function println_ts(message) if not smem.plc_state.fp_ok then util.println_ts(message) end end
---@class parallel_thread
@@ -682,7 +680,7 @@ function threads.thread__setpoint_control(smem)
-- we yielded, check enable again
if setpoints.burn_rate_en and (type(current_burn_rate) == "number") and (current_burn_rate ~= setpoints.burn_rate) then
-- calculate new burn rate
local new_burn_rate = current_burn_rate
local new_burn_rate ---@type number
if setpoints.burn_rate > current_burn_rate then
-- need to ramp up