From ef4836c1a55b7bc424e06b626b81cc4604b12172 Mon Sep 17 00:00:00 2001 From: skoglol <33292112+kriskog@users.noreply.github.com> Date: Thu, 23 Jul 2020 17:35:33 +0200 Subject: [PATCH 1/2] Merge pull request #52383 from spookydonut/leadingslash Fix leading slashes and turn on linting for it --- SpacemanDMM.toml | 4 ++++ code/__HELPERS/unsorted.dm | 2 +- code/datums/traits/good.dm | 4 ++-- code/game/machinery/hologram.dm | 2 +- code/game/mecha/combat/durand.dm | 2 +- code/game/objects/items/dice.dm | 2 +- code/game/objects/items/grenades/festive.dm | 4 ++-- code/modules/antagonists/_common/antag_datum.dm | 2 +- code/modules/atmospherics/gasmixtures/reactions.dm | 6 +++--- code/modules/cargo/coupon.dm | 2 +- .../recipes/tablecraft/recipes_pastry.dm | 2 +- code/modules/mining/aux_base_camera.dm | 14 +++++++------- .../mob/living/simple_animal/hostile/bear.dm | 4 ++-- .../mob/living/simple_animal/hostile/hostile.dm | 2 +- .../simple_animal/hostile/megafauna/drake.dm | 2 +- .../simple_animal/hostile/mining_mobs/basilisk.dm | 2 +- .../living/simple_animal/hostile/space_dragon.dm | 2 +- .../simple_animal/hostile/venus_human_trap.dm | 2 +- code/modules/photography/photos/album.dm | 4 ++-- code/modules/projectiles/guns/ballistic/rifle.dm | 8 ++++---- .../reagents/reagent_containers/chem_pack.dm | 2 +- .../xenobiology/crossbreeding/_status_effects.dm | 4 ++-- .../modules/shuttle/spaceship_navigation_beacon.dm | 2 +- 23 files changed, 42 insertions(+), 38 deletions(-) diff --git a/SpacemanDMM.toml b/SpacemanDMM.toml index b8274722546..9b658dce0fa 100644 --- a/SpacemanDMM.toml +++ b/SpacemanDMM.toml @@ -1,2 +1,6 @@ [langserver] dreamchecker = true + +[code_standards] +disallow_relative_type_definitions = true +disallow_relative_proc_definitions = true diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index c4316628538..afc014dcd8f 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -1094,7 +1094,7 @@ B --><-- A return closest_atom -proc/pick_closest_path(value, list/matches = get_fancy_list_of_atom_types()) +/proc/pick_closest_path(value, list/matches = get_fancy_list_of_atom_types()) if (value == FALSE) //nothing should be calling us with a number, so this is safe value = input("Enter type to find (blank for all, cancel to cancel)", "Search for type") as null|text if (isnull(value)) diff --git a/code/datums/traits/good.dm b/code/datums/traits/good.dm index aacbbf3f812..36bb8d27e3b 100644 --- a/code/datums/traits/good.dm +++ b/code/datums/traits/good.dm @@ -59,7 +59,7 @@ lose_text = "You feel isolated from others." medical_record_text = "Patient is highly perceptive of and sensitive to social cues, or may possibly have ESP. Further testing needed." -datum/quirk/fan_clown +/datum/quirk/fan_clown name = "Clown Fan" desc = "You enjoy clown antics and get a mood boost from wearing your clown pin." value = 1 @@ -79,7 +79,7 @@ datum/quirk/fan_clown var/datum/atom_hud/fan = GLOB.huds[DATA_HUD_FAN] fan.add_hud_to(H) -datum/quirk/fan_mime +/datum/quirk/fan_mime name = "Mime Fan" desc = "You enjoy mime antics and get a mood boost from wearing your mime pin." value = 1 diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm index bd974da88d9..e86c3f85cf9 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -84,7 +84,7 @@ Possible to do for anyone motivated enough: desc = "It's a floor-mounted device for projecting holographic images. This one will refuse to auto-connect incoming calls." secure = TRUE -obj/machinery/holopad/secure/Initialize() +/obj/machinery/holopad/secure/Initialize() . = ..() var/obj/item/circuitboard/machine/holopad/board = circuit board.secure = TRUE diff --git a/code/game/mecha/combat/durand.dm b/code/game/mecha/combat/durand.dm index efafa478429..f3622726bc3 100644 --- a/code/game/mecha/combat/durand.dm +++ b/code/game/mecha/combat/durand.dm @@ -91,7 +91,7 @@ Expects a turf. Returns true if the attack should be blocked, false if not.*/ . = TRUE return -obj/mecha/combat/durand/attack_generic(mob/user, damage_amount = 0, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, armor_penetration = 0) +/obj/mecha/combat/durand/attack_generic(mob/user, damage_amount = 0, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, armor_penetration = 0) if(defense_check(user.loc)) log_message("Attack absorbed by defense field. Attacker - [user].", LOG_MECHA, color="orange") shield.attack_generic(user, damage_amount, damage_type, damage_flag, sound_effect, armor_penetration) diff --git a/code/game/objects/items/dice.dm b/code/game/objects/items/dice.dm index 205caa3f600..4b599292f09 100644 --- a/code/game/objects/items/dice.dm +++ b/code/game/objects/items/dice.dm @@ -93,7 +93,7 @@ /obj/item/dice/d6 name = "d6" -obj/item/dice/d6/ebony +/obj/item/dice/d6/ebony name = "ebony die" desc = "A die with six sides made of dense black wood. It feels cold and heavy in your hand." icon_state = "de6" diff --git a/code/game/objects/items/grenades/festive.dm b/code/game/objects/items/grenades/festive.dm index 861b61b26f6..dba90466a14 100644 --- a/code/game/objects/items/grenades/festive.dm +++ b/code/game/objects/items/grenades/festive.dm @@ -84,7 +84,7 @@ /obj/item/grenade/firecracker/fire_act(exposed_temperature, exposed_volume) prime() -obj/item/grenade/firecracker/wirecutter_act(mob/living/user, obj/item/I) +/obj/item/grenade/firecracker/wirecutter_act(mob/living/user, obj/item/I) if(active) return if(det_time) @@ -96,7 +96,7 @@ obj/item/grenade/firecracker/wirecutter_act(mob/living/user, obj/item/I) else to_chat(user, "You've already removed all of the fuse!") -obj/item/grenade/firecracker/preprime(mob/user, delayoverride, msg = TRUE, volume = 80) +/obj/item/grenade/firecracker/preprime(mob/user, delayoverride, msg = TRUE, volume = 80) var/turf/T = get_turf(src) log_grenade(user, T) if(user) diff --git a/code/modules/antagonists/_common/antag_datum.dm b/code/modules/antagonists/_common/antag_datum.dm index 7bac12db69f..f8c054b9941 100644 --- a/code/modules/antagonists/_common/antag_datum.dm +++ b/code/modules/antagonists/_common/antag_datum.dm @@ -266,7 +266,7 @@ GLOBAL_LIST_EMPTY(antagonists) show_name_in_check_antagonists = TRUE //They're all different var/datum/team/custom_team -datum/antagonist/custom/create_team(datum/team/team) +/datum/antagonist/custom/create_team(datum/team/team) custom_team = team /datum/antagonist/custom/get_team() diff --git a/code/modules/atmospherics/gasmixtures/reactions.dm b/code/modules/atmospherics/gasmixtures/reactions.dm index cc3b6510841..5fc436c7ca3 100644 --- a/code/modules/atmospherics/gasmixtures/reactions.dm +++ b/code/modules/atmospherics/gasmixtures/reactions.dm @@ -260,18 +260,18 @@ nobiliumsuppression = INFINITY return cached_results["fire"] ? REACTING : NO_REACTION //freon reaction (is not a fire yet) -datum/gas_reaction/freonfire +/datum/gas_reaction/freonfire priority = -4 name = "Freon combustion" id = "freonfire" -datum/gas_reaction/freonfire/init_reqs() +/datum/gas_reaction/freonfire/init_reqs() min_requirements = list( /datum/gas/oxygen = MINIMUM_MOLE_COUNT, /datum/gas/freon = MINIMUM_MOLE_COUNT ) -datum/gas_reaction/freonfire/react(datum/gas_mixture/air, datum/holder) +/datum/gas_reaction/freonfire/react(datum/gas_mixture/air, datum/holder) var/energy_released = 0 var/old_heat_capacity = air.heat_capacity() var/list/cached_gases = air.gases //this speeds things up because accessing datum vars is slow diff --git a/code/modules/cargo/coupon.dm b/code/modules/cargo/coupon.dm index 80df3684ef4..ac77a994a03 100644 --- a/code/modules/cargo/coupon.dm +++ b/code/modules/cargo/coupon.dm @@ -1,6 +1,6 @@ #define COUPON_OMEN "omen" -obj/item/coupon +/obj/item/coupon name = "coupon" desc = "It doesn't matter if you didn't want it before, what matters now is that you've got a coupon for it!" icon_state = "data_1" diff --git a/code/modules/food_and_drinks/recipes/tablecraft/recipes_pastry.dm b/code/modules/food_and_drinks/recipes/tablecraft/recipes_pastry.dm index 8dfcb5b9097..94419a58c28 100644 --- a/code/modules/food_and_drinks/recipes/tablecraft/recipes_pastry.dm +++ b/code/modules/food_and_drinks/recipes/tablecraft/recipes_pastry.dm @@ -23,7 +23,7 @@ ) result = /obj/item/reagent_containers/food/snacks/donut/chaos -datum/crafting_recipe/food/donut/meat +/datum/crafting_recipe/food/donut/meat time = 15 name = "Meat donut" reqs = list( diff --git a/code/modules/mining/aux_base_camera.dm b/code/modules/mining/aux_base_camera.dm index 12d7ae32b29..b013bc42e62 100644 --- a/code/modules/mining/aux_base_camera.dm +++ b/code/modules/mining/aux_base_camera.dm @@ -202,27 +202,27 @@ name = "Select Airlock Type" button_icon_state = "airlock_select" -datum/action/innate/aux_base/airlock_type/Activate() +/datum/action/innate/aux_base/airlock_type/Activate() if(..()) return B.RCD.change_airlock_setting() -datum/action/innate/aux_base/window_type +/datum/action/innate/aux_base/window_type name = "Select Window Type" button_icon_state = "window_select" -datum/action/innate/aux_base/window_type/Activate() +/datum/action/innate/aux_base/window_type/Activate() if(..()) return B.RCD.toggle_window_type() -datum/action/innate/aux_base/place_fan +/datum/action/innate/aux_base/place_fan name = "Place Tiny Fan" button_icon_state = "build_fan" -datum/action/innate/aux_base/place_fan/Activate() +/datum/action/innate/aux_base/place_fan/Activate() if(..()) return @@ -244,11 +244,11 @@ datum/action/innate/aux_base/place_fan/Activate() to_chat(owner, "Tiny fan placed. [B.fans_remaining] remaining.") playsound(fan_turf, 'sound/machines/click.ogg', 50, TRUE) -datum/action/innate/aux_base/install_turret +/datum/action/innate/aux_base/install_turret name = "Install Plasma Anti-Wildlife Turret" button_icon_state = "build_turret" -datum/action/innate/aux_base/install_turret/Activate() +/datum/action/innate/aux_base/install_turret/Activate() if(..()) return diff --git a/code/modules/mob/living/simple_animal/hostile/bear.dm b/code/modules/mob/living/simple_animal/hostile/bear.dm index 7f3056ec998..a126e93d013 100644 --- a/code/modules/mob/living/simple_animal/hostile/bear.dm +++ b/code/modules/mob/living/simple_animal/hostile/bear.dm @@ -128,7 +128,7 @@ to_chat(user, "You strap the armor plating to [A] and sharpen [A.p_their()] claws with the nail filer. This was a great idea.") qdel(src) -mob/living/simple_animal/hostile/bear/butter //The mighty companion to Cak. Several functions used from it. +/mob/living/simple_animal/hostile/bear/butter //The mighty companion to Cak. Several functions used from it. name = "Terrygold" icon_state = "butterbear" icon_living = "butterbear" @@ -173,7 +173,7 @@ mob/living/simple_animal/hostile/bear/butter //The mighty companion to Cak. Seve to_chat(src, "Your name is now \"new_name\"!") name = new_name -mob/living/simple_animal/hostile/bear/butter/AttackingTarget() //Makes some attacks by the butter bear slip those who dare cross its path. +/mob/living/simple_animal/hostile/bear/butter/AttackingTarget() //Makes some attacks by the butter bear slip those who dare cross its path. if(isliving(target)) var/mob/living/L = target if((L.mobility_flags & MOBILITY_STAND)) diff --git a/code/modules/mob/living/simple_animal/hostile/hostile.dm b/code/modules/mob/living/simple_animal/hostile/hostile.dm index 78fed859431..fa33a58b4a5 100644 --- a/code/modules/mob/living/simple_animal/hostile/hostile.dm +++ b/code/modules/mob/living/simple_animal/hostile/hostile.dm @@ -466,7 +466,7 @@ DestroyObjectsInDirection(direction) -mob/living/simple_animal/hostile/proc/DestroySurroundings() // for use with megafauna destroying everything around them +/mob/living/simple_animal/hostile/proc/DestroySurroundings() // for use with megafauna destroying everything around them if(environment_smash) EscapeConfinement() for(var/dir in GLOB.cardinals) diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/drake.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/drake.dm index 761578c030a..d9f3340e3f6 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/drake.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/drake.dm @@ -520,7 +520,7 @@ Difficulty: Medium else animate(src, pixel_x = -16, pixel_z = 0, time = 5) -obj/effect/temp_visual/fireball +/obj/effect/temp_visual/fireball icon = 'icons/obj/wizard.dmi' icon_state = "fireball" name = "fireball" diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/basilisk.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/basilisk.dm index ef5784a93a0..fd4b832575d 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/basilisk.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/basilisk.dm @@ -81,7 +81,7 @@ projectiletype = /obj/projectile/temp/basilisk/heated addtimer(CALLBACK(src, .proc/cool_down), 3000) -mob/living/simple_animal/hostile/asteroid/basilisk/proc/cool_down() +/mob/living/simple_animal/hostile/asteroid/basilisk/proc/cool_down() visible_message("[src] appears to be cooling down...") if(stat != DEAD) icon_state = "Basilisk" diff --git a/code/modules/mob/living/simple_animal/hostile/space_dragon.dm b/code/modules/mob/living/simple_animal/hostile/space_dragon.dm index b0793ee453e..dec465d9516 100644 --- a/code/modules/mob/living/simple_animal/hostile/space_dragon.dm +++ b/code/modules/mob/living/simple_animal/hostile/space_dragon.dm @@ -209,7 +209,7 @@ * Arguments: * * turf/T - The turf to trigger the effects on. */ -mob/living/simple_animal/hostile/space_dragon/proc/dragon_fire_line(turf/T) +/mob/living/simple_animal/hostile/space_dragon/proc/dragon_fire_line(turf/T) var/list/hit_list = list() hit_list += src new /obj/effect/hotspot(T) diff --git a/code/modules/mob/living/simple_animal/hostile/venus_human_trap.dm b/code/modules/mob/living/simple_animal/hostile/venus_human_trap.dm index c07032fe4e3..51d807e713a 100644 --- a/code/modules/mob/living/simple_animal/hostile/venus_human_trap.dm +++ b/code/modules/mob/living/simple_animal/hostile/venus_human_trap.dm @@ -188,5 +188,5 @@ * Arguments: * * datum/beam/vine - The vine to be removed from the list. */ -mob/living/simple_animal/hostile/venus_human_trap/proc/remove_vine(datum/beam/vine, force) +/mob/living/simple_animal/hostile/venus_human_trap/proc/remove_vine(datum/beam/vine, force) vines -= vine diff --git a/code/modules/photography/photos/album.dm b/code/modules/photography/photos/album.dm index 4d12d0c8565..b09805c3cb6 100644 --- a/code/modules/photography/photos/album.dm +++ b/code/modules/photography/photos/album.dm @@ -96,10 +96,10 @@ name = "photo album (Library)" persistence_id = "library" -obj/item/storage/photo_album/chapel +/obj/item/storage/photo_album/chapel name = "photo album (Chapel)" persistence_id = "chapel" -obj/item/storage/photo_album/prison +/obj/item/storage/photo_album/prison name = "photo album (Prison)" persistence_id = "prison" diff --git a/code/modules/projectiles/guns/ballistic/rifle.dm b/code/modules/projectiles/guns/ballistic/rifle.dm index 980a2722e43..1da8baa8024 100644 --- a/code/modules/projectiles/guns/ballistic/rifle.dm +++ b/code/modules/projectiles/guns/ballistic/rifle.dm @@ -16,11 +16,11 @@ bolt_drop_sound = 'sound/weapons/gun/rifle/bolt_in.ogg' tac_reloads = FALSE -obj/item/gun/ballistic/rifle/update_overlays() +/obj/item/gun/ballistic/rifle/update_overlays() . = ..() . += "[icon_state]_bolt[bolt_locked ? "_locked" : ""]" -obj/item/gun/ballistic/rifle/rack(mob/user = null) +/obj/item/gun/ballistic/rifle/rack(mob/user = null) if (bolt_locked == FALSE) to_chat(user, "You open the bolt of \the [src].") playsound(src, rack_sound, rack_sound_volume, rack_sound_vary) @@ -30,12 +30,12 @@ obj/item/gun/ballistic/rifle/rack(mob/user = null) return drop_bolt(user) -obj/item/gun/ballistic/rifle/can_shoot() +/obj/item/gun/ballistic/rifle/can_shoot() if (bolt_locked) return FALSE return ..() -obj/item/gun/ballistic/rifle/attackby(obj/item/A, mob/user, params) +/obj/item/gun/ballistic/rifle/attackby(obj/item/A, mob/user, params) if (!bolt_locked) to_chat(user, "The bolt is closed!") return diff --git a/code/modules/reagents/reagent_containers/chem_pack.dm b/code/modules/reagents/reagent_containers/chem_pack.dm index 4bb64506100..666f812e705 100644 --- a/code/modules/reagents/reagent_containers/chem_pack.dm +++ b/code/modules/reagents/reagent_containers/chem_pack.dm @@ -33,7 +33,7 @@ . += "Alt-click to seal it." -obj/item/reagent_containers/chem_pack/attack_self(mob/user) +/obj/item/reagent_containers/chem_pack/attack_self(mob/user) if(sealed) return ..() diff --git a/code/modules/research/xenobiology/crossbreeding/_status_effects.dm b/code/modules/research/xenobiology/crossbreeding/_status_effects.dm index ac3a051031b..4439a19b448 100644 --- a/code/modules/research/xenobiology/crossbreeding/_status_effects.dm +++ b/code/modules/research/xenobiology/crossbreeding/_status_effects.dm @@ -223,7 +223,7 @@ duration = -1 alert_type = null -datum/status_effect/rebreathing/tick() +/datum/status_effect/rebreathing/tick() owner.adjustOxyLoss(-6, 0) //Just a bit more than normal breathing. /////////////////////////////////////////////////////// @@ -505,7 +505,7 @@ datum/status_effect/rebreathing/tick() ADD_TRAIT(owner, TRAIT_NOSLIPWATER, "slimestatus") return ..() -datum/status_effect/stabilized/blue/on_remove() +/datum/status_effect/stabilized/blue/on_remove() REMOVE_TRAIT(owner, TRAIT_NOSLIPWATER, "slimestatus") /datum/status_effect/stabilized/metal diff --git a/code/modules/shuttle/spaceship_navigation_beacon.dm b/code/modules/shuttle/spaceship_navigation_beacon.dm index ec6efb1e6b4..e5b4cf4ea79 100644 --- a/code/modules/shuttle/spaceship_navigation_beacon.dm +++ b/code/modules/shuttle/spaceship_navigation_beacon.dm @@ -21,7 +21,7 @@ . = ..() SSshuttle.beacons |= src -obj/machinery/spaceship_navigation_beacon/emp_act() +/obj/machinery/spaceship_navigation_beacon/emp_act() locked = TRUE /obj/machinery/spaceship_navigation_beacon/Destroy()