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
@@ -28,7 +28,7 @@
if(!enable_special)
target = get_turf(chassis)
var/datum/beam/ScanBeam = chassis.Beam(target,"g_beam",'icons/effects/beam.dmi',time=2 SECONDS,10,/obj/effect/ebeam,2)
var/datum/beam/ScanBeam = chassis.Beam(target, "g_beam", 'icons/effects/beam.dmi', 2 SECONDS, 10, /obj/effect/ebeam, 2)
if(do_after(chassis.occupant, 2 SECONDS))
my_scanner.ScanTurf(target, chassis.occupant, exact_scan)
@@ -67,7 +67,6 @@
return
/obj/item/mecha_parts/mecha_equipment/combat_shield/proc/toggle_shield()
..()
if(chassis)
my_shield.attack_self(chassis.occupant)
if(my_shield.active)
@@ -39,7 +39,6 @@
shields.update_shield_positions()
/obj/item/mecha_parts/mecha_equipment/omni_shield/proc/toggle_shield()
..()
if(shields)
shields.set_on(!shields.active)
if(shields.active)
@@ -454,7 +454,6 @@
E.status &= ~ORGAN_BROKEN
/obj/item/mecha_parts/mecha_equipment/crisis_drone/proc/toggle_drone()
..()
if(chassis)
enabled = !enabled
if(enabled)
+1 -1
View File
@@ -43,7 +43,7 @@
var/turf/aimloc = targloc
if(deviation)
aimloc = locate(targloc.x+GaussRandRound(deviation,1),targloc.y+GaussRandRound(deviation,1),targloc.z)
if(!aimloc || aimloc == curloc || (locs && aimloc in locs))
if(!aimloc || aimloc == curloc || (locs && (aimloc in locs)))
break
playsound(src, fire_sound, fire_volume, 1)
projectiles--
+4 -5
View File
@@ -1571,7 +1571,7 @@
return 0
/obj/mecha/proc/mmi_moved_inside(var/obj/item/device/mmi/mmi_as_oc as obj,mob/user as mob)
if(mmi_as_oc && user in range(1))
if(mmi_as_oc && (user in range(1)))
if(!mmi_as_oc.brainmob || !mmi_as_oc.brainmob.client)
to_chat(user, "Consciousness matrix not detected.")
return 0
@@ -1888,7 +1888,7 @@
return
/obj/mecha/proc/moved_inside(var/mob/living/carbon/human/H as mob)
if(H && H.client && H in range(1))
if(H && H.client && (H in range(1)))
H.reset_view(src)
/*
H.client.perspective = EYE_PERSPECTIVE
@@ -2498,7 +2498,7 @@
var/mob/occupant = P.occupant
user.visible_message("<span class='notice'>\The [user] begins opening the hatch on \the [P]...</span>", "<span class='notice'>You begin opening the hatch on \the [P]...</span>")
if (!do_after(user, 40, needhand=0))
if (!do_after(user, 40))
return
user.visible_message("<span class='notice'>\The [user] opens the hatch on \the [P] and removes [occupant]!</span>", "<span class='notice'>You open the hatch on \the [P] and remove [occupant]!</span>")
@@ -2548,7 +2548,7 @@
src.log_message("Recalibration of coordination system failed with 1 error.",1)
if(href_list["drop_from_cargo"])
var/obj/O = locate(href_list["drop_from_cargo"])
if(O && O in src.cargo)
if(O && (O in src.cargo))
src.occupant_message("<span class='notice'>You unload [O].</span>")
O.forceMove(get_turf(src))
src.cargo -= O
@@ -2616,7 +2616,6 @@
AI.icon_state = "ai-crash"
src.occupant = cur_occupant
*/
return
///////////////////////
///// Power stuff /////