Linter Introduction + Cleanup (#8085)

* Adds linter defines to repo.

* Uncomments linter defines already in the code.

* Resolves unreachable code linter errors.

* Nukes decade+ old syndie specops code except for computer since that's mapped in?????

* Resolves procs has no parent linter error.

* Proc signature fixes

* Bad comments

* "In" danger

* Type safety

* Implied nested list abuse

* Top level ..() usage

* Sleepy coder typos

* Invalid kwargs calls

* Pointless returns

* Linter hacks (see full message)

Byond doesn't care and it has no effect but linter doesn't like var/proc
for holding references to procs, despite that it's valid byond code.

Also, the linter seems to have serious issues figuring out relative
proc names. This commit is a sort of take-it-or-leave-it thing. It's not
required, it just cuts down on warnings, but this code is valid DM code.

* WHATEVER THIS IS

* Trick dreamchecker linter into ignoring this file's sins in it's weird use of vars

* Fix list decoration syntax - Its a list, not list of lists

- To declare that a var is a list you can `var/list/blah = list()` syntax or the `var/blah[0]` syntax.  Both do exactly the same thing. But if you do `var/list/blah[0]` that is just like doing `var/list/list/blah = list()`

* Hopefully stops the ai holder subtype folder from going quantum and sometimes changes capitalization over time, and incidentally causing 20+ linter errors.

* Fixes unwrapped negated object in list linter error.

* Resolves colon-like list accessing linter error.

* Turns linter on in linter config.

* Fixes closet indentation properly and cleans up suit storage unit switch.

Co-authored-by: Aronai Sieyes <arokha@arokha.com>
Co-authored-by: Leshana <Leshana@users.noreply.github.com>
This commit is contained in:
Neerti
2021-05-25 23:17:26 -04:00
committed by GitHub
parent 9667dad5ba
commit fdabe51ee8
201 changed files with 3551 additions and 3824 deletions

View File

@@ -60,7 +60,7 @@
/obj/machinery/shield_gen/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/weapon/card/id))
var/obj/item/weapon/card/id/C = W
if(access_captain in C.access || access_security in C.access || access_engine in C.access)
if((access_captain in C.access) || (access_security in C.access) || (access_engine in C.access))
src.locked = !src.locked
to_chat(user, "Controls are now [src.locked ? "locked." : "unlocked."]")
updateDialog()
@@ -110,36 +110,35 @@
return ..()
/obj/machinery/shield_gen/tgui_data(mob/user)
var/list/data = list()
var/list/lockedData = list()
data["locked"] = locked
data["lockedData"] = list()
if(!locked)
data["lockedData"]["capacitors"] = list()
var/list/caps = list()
for(var/obj/machinery/shield_capacitor/C in capacitors)
data["lockedData"]["capacitors"].Add(list(list(
caps.Add(list(list(
"active" = C.active,
"stored_charge" = C.stored_charge,
"max_charge" = C.max_charge,
"failing" = (C.time_since_fail <= 2),
)))
lockedData["capacitors"] = caps
data["lockedData"]["active"] = active
data["lockedData"]["failing"] = (time_since_fail <= 2)
data["lockedData"]["radius"] = field_radius
data["lockedData"]["max_radius"] = max_field_radius
data["lockedData"]["z_range"] = z_range
data["lockedData"]["max_z_range"] = 10
data["lockedData"]["average_field_strength"] = average_field_strength
data["lockedData"]["target_field_strength"] = target_field_strength
data["lockedData"]["max_field_strength"] = max_field_strength
data["lockedData"]["shields"] = LAZYLEN(field)
data["lockedData"]["upkeep"] = round(field.len * max(average_field_strength * dissipation_rate, min_dissipation) / energy_conversion_rate)
data["lockedData"]["strengthen_rate"] = strengthen_rate
data["lockedData"]["max_strengthen_rate"] = max_strengthen_rate
data["lockedData"]["gen_power"] = round(field.len * min(strengthen_rate, target_field_strength - average_field_strength) / energy_conversion_rate)
lockedData["active"] = active
lockedData["failing"] = (time_since_fail <= 2)
lockedData["radius"] = field_radius
lockedData["max_radius"] = max_field_radius
lockedData["z_range"] = z_range
lockedData["max_z_range"] = 10
lockedData["average_field_strength"] = average_field_strength
lockedData["target_field_strength"] = target_field_strength
lockedData["max_field_strength"] = max_field_strength
lockedData["shields"] = LAZYLEN(field)
lockedData["upkeep"] = round(field.len * max(average_field_strength * dissipation_rate, min_dissipation) / energy_conversion_rate)
lockedData["strengthen_rate"] = strengthen_rate
lockedData["max_strengthen_rate"] = max_strengthen_rate
lockedData["gen_power"] = round(field.len * min(strengthen_rate, target_field_strength - average_field_strength) / energy_conversion_rate)
return data
return list("locked" = locked, "lockedData" = lockedData)
/obj/machinery/shield_gen/process()
if (!anchored && active)