Skip to content

Commit

Permalink
Updates OD lints (ParadiseSS13#26729)
Browse files Browse the repository at this point in the history
* yea

* update lints

* lint changes and code fixes

* i hate old code

* dont make this an error
  • Loading branch information
Contrabang authored Sep 27, 2024
1 parent 2a58ce0 commit 900271a
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 18 deletions.
2 changes: 1 addition & 1 deletion code/__HELPERS/paths/path.dm
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ GLOBAL_LIST_INIT(can_pass_info_vars, GLOBAL_PROC_REF(can_pass_check_vars))

/datum/can_pass_info/proc/compare_against(datum/can_pass_info/check_against)
for(var/comparable_var in GLOB.can_pass_info_vars)
if(!(vars[comparable_var] ~= check_against[comparable_var]))
if(!(vars[comparable_var] ~= check_against.vars[comparable_var]))
return FALSE
if(!pulling_info != !check_against.pulling_info)
return FALSE
Expand Down
2 changes: 1 addition & 1 deletion code/datums/components/orbiter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@
var/list/output = list()
if(!processed)
processed = list()
if(src in processed || isturf(src))
if((src in processed) || isturf(src))
return output

processed += src
Expand Down
2 changes: 1 addition & 1 deletion code/datums/spells/mind_transfer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Also, you never added distance checking after target is selected. I've went ahea
to_chat(user, "<span class='warning'>You're killing yourself! You can't concentrate enough to do this!</span>")
return

if(target.mind.special_role in protected_roles && target != user)
if((target.mind.special_role in protected_roles) && target != user)
to_chat(user, "<span class='danger'>Their mind is resisting your spell.</span>")
return

Expand Down
2 changes: 1 addition & 1 deletion code/datums/uplink_items/uplink_general.dm
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item))
return

// If the uplink's holder is in the user's contents
if((U.loc in user.contents || (in_range(U.loc, user) && isturf(U.loc.loc))))
if(((U.loc in user.contents) || (in_range(U.loc, user) && isturf(U.loc.loc))))
if(cost > U.uses)
return

Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/structures/safe.dm
Original file line number Diff line number Diff line change
Expand Up @@ -339,14 +339,14 @@ GLOBAL_LIST_EMPTY(safes)
if(get_dist(src, driller) >= 9)
return //You need to be near the drill if you want to get the buff.
for(var/mob/living/carbon/human/H in view(9, src))
if(H.job in list("Security Officer", "Detective", "Warden", "Head of Security", "Captain", "Clown") || H.mind.special_role == SPECIAL_ROLE_ERT)
if((H.job in list("Security Officer", "Detective", "Warden", "Head of Security", "Captain", "Clown")) || H.mind.special_role == SPECIAL_ROLE_ERT)
if(H.mind && H.mind.special_role && H.mind.special_role != SPECIAL_ROLE_ERT)
continue
drill.spotted = TRUE
security_assualt_in_progress()
return
for(var/mob/living/carbon/human/H in view(9, driller))
if(H.job in list("Security Officer", "Detective", "Warden", "Head of Security", "Captain", "Clown") || H.mind.special_role == SPECIAL_ROLE_ERT)
if((H.job in list("Security Officer", "Detective", "Warden", "Head of Security", "Captain", "Clown")) || H.mind.special_role == SPECIAL_ROLE_ERT)
if(H.mind && H.mind.special_role && H.mind.special_role != SPECIAL_ROLE_ERT)
continue
drill.spotted = TRUE
Expand Down
2 changes: 1 addition & 1 deletion code/modules/clothing/under/accessories/accessory.dm
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@
var/obj/item/pda/pda = I
id_card = pda.id

if(ACCESS_SEC_DOORS in id_card.access || emagged)
if((ACCESS_SEC_DOORS in id_card.access) || emagged)
to_chat(user, "<span class='notice'>You imprint your ID details onto the badge.</span>")
stored_name = id_card.registered_name
name = "holobadge ([stored_name])"
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/simple_animal/bot/honkbot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@
if(emagged) // actually emagged
bike_horn()
else
if(C in view(4, src) && !spam_flag) //keep the range short for patrolling
if((C in view(4, src)) && !spam_flag) //keep the range short for patrolling
bike_horn()
continue

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ Difficulty: Medium
hotspot.recolor()
T.hotspot_expose(700,50,1)
for(var/mob/living/L in T.contents)
if(L in hit_list || L == source)
if((L in hit_list) || L == source)
continue
hit_list += L
L.adjustFireLoss(20)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/paperwork/paper.dm
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@
add_hiddenprint(usr) // No more forging nasty documents as someone else, you jerks
if(!is_pen(item_write) && !istype(item_write, /obj/item/toy/crayon))
return
if(loc != usr && !Adjacent(usr) && !((istype(loc, /obj/item/clipboard) || istype(loc, /obj/item/folder)) && (usr in get_turf(src) || loc.Adjacent(usr))))
if(loc != usr && !Adjacent(usr) && !((istype(loc, /obj/item/clipboard) || istype(loc, /obj/item/folder)) && ((usr in get_turf(src)) || loc.Adjacent(usr))))
return // If paper is not in usr, then it must be near them, or in a clipboard or folder, which must be in or near usr
input_element = parsepencode(input_element, item_write, usr) // Encode everything from pencode to html
if(id != "end")
Expand Down
18 changes: 12 additions & 6 deletions code/modules/paperwork/paper_bundle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
else
if(is_pen(W) || istype(W, /obj/item/toy/crayon))
usr << browse("", "window=PaperBundle[UID()]") //Closes the dialog
P = src[page]
P = get_page()
P.attackby(W, user, params)

update_icon()
Expand Down Expand Up @@ -106,7 +106,7 @@

/obj/item/paper_bundle/proc/show_content(mob/user as mob)
var/dat = {"<!DOCTYPE html><meta charset="UTF-8">"}
var/obj/item/W = src[page]
var/obj/item/W = get_page()
switch(screen)
if(0)
dat+= "<DIV STYLE='float:left; text-align:left; width:33.33333%'></DIV>"
Expand All @@ -120,11 +120,11 @@
dat+= "<DIV STYLE='float:left; text-align:left; width:33.33333%'><A href='byond://?src=[UID()];prev_page=1'>Previous Page</A></DIV>"
dat+= "<DIV STYLE='float:left; text-align:center; width:33.33333%'><A href='byond://?src=[UID()];remove=1'>Remove [(istype(W, /obj/item/paper)) ? "paper" : "photo"]</A></DIV><BR><HR>"
dat+= "<DIV STYLE='float;left; text-align:right; with:33.33333%'></DIV>"
if(istype(src[page], /obj/item/paper))
if(istype(W, /obj/item/paper))
var/obj/item/paper/P = W
dat += P.show_content(usr, view = 0)
usr << browse(dat, "window=PaperBundle[UID()]")
else if(istype(src[page], /obj/item/photo))
else if(istype(W, /obj/item/photo))
var/obj/item/photo/P = W
usr << browse_rsc(P.img, "tmp_photo.png")
usr << browse(dat + "<html><meta charset='utf-8'><head><title>[P.name]</title></head>" \
Expand Down Expand Up @@ -162,11 +162,11 @@
playsound(loc, "pageturn", 50, 1)

if(href_list["remove"])
var/obj/item/W = src[page]
var/obj/item/W = get_page()
usr.put_in_hands(W)
to_chat(usr, "<span class='notice'>You remove [W] from the bundle.</span>")
if(amount == 1)
var/obj/item/paper/P = src[1]
var/obj/item/paper/P = get_page(1)
usr.unEquip(src)
usr.put_in_hands(P)
usr.unset_machine() // Ensure the bundle GCs
Expand Down Expand Up @@ -234,6 +234,7 @@
desc = "A single sheet of paper."
if(photos)
desc += "\nThere [photos == 1 ? "is a photo" : "are [photos] photos"] attached to it."

/obj/item/paper_bundle/update_icon_state()
if(length(contents))
var/obj/item/paper/P = contents[1]
Expand Down Expand Up @@ -268,3 +269,8 @@

. += "clip"
update_desc()

/obj/item/paper_bundle/proc/get_page(page_override)
if(page_override)
return contents[page_override]
return contents[page]
2 changes: 1 addition & 1 deletion code/modules/surgery/abstract_steps.dm
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
for(var/allowed in first_step.allowed_tools)
if(ispath(allowed) && istype(tool, allowed) || (tool && istype(tool) && tool.tool_behaviour == allowed))
next_surgery = S
if(allowed in starting_tools && !(allowed in overriding_tools))
if((allowed in starting_tools) && !(allowed in overriding_tools))
CRASH("[src] was provided with multiple branches that start with tool [allowed].")
else
starting_tools.Add(allowed)
Expand Down
17 changes: 16 additions & 1 deletion tools/ci/lints.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//1000-1999
#pragma FileAlreadyIncluded error
#pragma MissingIncludedFile error
#pragma InvalidWarningCode warning
#pragma MisplacedDirective error
#pragma UndefineMissingDirective error
#pragma DefinedMissingParen error
Expand All @@ -12,7 +13,6 @@
#pragma SoftReservedKeyword error
#pragma DuplicateVariable error
#pragma DuplicateProcDefinition error
#pragma TooManyArguments error
#pragma PointlessParentCall error
#pragma PointlessBuiltinCall error
#pragma SuspiciousMatrixCall error
Expand All @@ -22,13 +22,28 @@
#pragma InvalidRange error
#pragma InvalidSetStatement error
#pragma InvalidOverride error
#pragma InvalidIndexOperation error
#pragma DanglingVarType error
#pragma MissingInterpolatedExpression error
#pragma AmbiguousResourcePath error
#pragma SuspiciousSwitchCase error
#pragma PointlessPositionalArgument error
// NOTE: The next few pragmas are for OpenDream's experimental type checker
// This feature is still in development, elevating these pragmas outside of local testing is discouraged
// An RFC to finalize this feature is coming soon(TM)
// BEGIN TYPEMAKER
#pragma UnsupportedTypeCheck disabled
#pragma InvalidReturnType disabled
#pragma InvalidVarType disabled
#pragma ImplicitNullType disabled
#pragma LostTypeInfo disabled
// END TYPEMAKER
#pragma UnimplementedAccess error

//3000-3999
#pragma EmptyBlock error
#pragma EmptyProc error
#pragma UnsafeClientAccess disabled
#pragma AssignmentInConditional error
#pragma PickWeightedSyntax disabled
#pragma AmbiguousInOrder error

0 comments on commit 900271a

Please sign in to comment.