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

@@ -5,7 +5,7 @@ SUBSYSTEM_DEF(chat)
priority = FIRE_PRIORITY_CHAT
init_order = INIT_ORDER_CHAT
var/list/msg_queue = list()
var/list/list/msg_queue = list() //List of lists
/datum/controller/subsystem/chat/Initialize(timeofday)
init_vchat()

View File

@@ -38,7 +38,7 @@ SUBSYSTEM_DEF(events)
return
for(var/i = EVENT_LEVEL_MUNDANE to EVENT_LEVEL_MAJOR)
var/list/datum/event_container/EC = event_containers[i]
var/datum/event_container/EC = event_containers[i]
EC.process()
/datum/controller/subsystem/events/stat_entry()

View File

@@ -32,6 +32,10 @@ SUBSYSTEM_DEF(persistence)
if(!A || (A.flags & AREA_FLAG_IS_NOT_PERSISTENT))
return
// if((!T.z in GLOB.using_map.station_levels) || !initialized)
if(!(T.z in using_map.station_levels))
return
if(!(T.z in using_map.persist_levels))
return
@@ -57,4 +61,4 @@ SUBSYSTEM_DEF(persistence)
dat += "</table>"
var/datum/browser/popup = new(user, "admin_persistence", "Persistence Data")
popup.set_content(jointext(dat, null))
popup.open()
popup.open()

View File

@@ -33,7 +33,7 @@ SUBSYSTEM_DEF(planets)
z_to_planet[Z] = NP
// DO NOT CALL THIS DIRECTLY UNLESS IT'S IN INITIALIZE,
// USE turf/simulated/proc/make_indoors() and\
// USE turf/simulated/proc/make_indoors() and
// tyrf/simulated/proc/make_outdoors()
/datum/controller/subsystem/planets/proc/addTurf(var/turf/T)
if(z_to_planet.len >= T.z && z_to_planet[T.z])

View File

@@ -336,7 +336,7 @@ var/global/datum/controller/subsystem/ticker/ticker
switch(M.z)
if(0) //inside a crate or something
var/turf/T = get_turf(M)
if(T && T.z in using_map.station_levels) //we don't use M.death(0) because it calls a for(/mob) loop and
if(T && (T.z in using_map.station_levels)) //we don't use M.death(0) because it calls a for(/mob) loop and
M.health = 0
M.set_stat(DEAD)
if(1) //on a z-level 1 turf.

View File

@@ -160,8 +160,7 @@ SUBSYSTEM_DEF(timer)
if (timer.timeToRun < head_offset)
bucket_resolution = null //force bucket recreation
CRASH("[i] Invalid timer state: Timer in long run queue with a time to run less then head_offset. [get_timer_debug_string(timer)] world.time: [world.time], head_offset: [head_offset], practical_offset: [practical_offset]")
crash_with("[i] Invalid timer state: Timer in long run queue with a time to run less then head_offset. [get_timer_debug_string(timer)] world.time: [world.time], head_offset: [head_offset], practical_offset: [practical_offset]")
if (timer.callBack && !timer.spent)
timer.callBack.InvokeAsync()
spent += timer
@@ -172,7 +171,7 @@ SUBSYSTEM_DEF(timer)
if (timer.timeToRun < head_offset + TICKS2DS(practical_offset-1))
bucket_resolution = null //force bucket recreation
CRASH("[i] Invalid timer state: Timer in long run queue that would require a backtrack to transfer to short run queue. [get_timer_debug_string(timer)] world.time: [world.time], head_offset: [head_offset], practical_offset: [practical_offset]")
crash_with("[i] Invalid timer state: Timer in long run queue that would require a backtrack to transfer to short run queue. [get_timer_debug_string(timer)] world.time: [world.time], head_offset: [head_offset], practical_offset: [practical_offset]")
if (timer.callBack && !timer.spent)
timer.callBack.InvokeAsync()
spent += timer

View File

@@ -31,7 +31,7 @@ SUBSYSTEM_DEF(xenoarch)
/datum/controller/subsystem/xenoarch/proc/SetupXenoarch()
for(var/turf/simulated/mineral/M in world)
if(!M.density || M.z in using_map.xenoarch_exempt_levels)
if(!M.density || (M.z in using_map.xenoarch_exempt_levels))
continue
if(isnull(M.geologic_data))