Skip to content

Commit

Permalink
OpenDream linting (Aurorastation#16468)
Browse files Browse the repository at this point in the history
* I wanna set the universe on fire

* dfsaaf

* setup

* dir issue?

* dsf

* Perhaps the script

* saf

* cry

* pain

* sdfas

* Try reintroduction of tag-matcher

* Failed

* Tries to suppress dotnet compile warnings

* Like this maybe?

* woopsie

* Damn pathings

* Hate

* Pragmas

* unlint?

* Maybe?

* GDI

* Redundant ifdef removed and changelog

* Did I forgot the tag matcher, or it was still broken?

* Yea no that script is still broken

* Removed tag-matcher as requested

* *sigh*

* test

* bro what?

* hope

* just fixing the input

* Let's see if we catch it...
  • Loading branch information
FluffyGhoster committed Jun 26, 2023
1 parent 6947b31 commit 5e1332d
Show file tree
Hide file tree
Showing 138 changed files with 399 additions and 545 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/byond.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,19 @@ jobs:
pip install --user -r ./tools/requirements.txt
chmod +x ./scripts/code_check.sh && ./scripts/code_check.sh $PWD
bash tools/ci/install_spaceman_dmm.sh dreamchecker
bash tools/ci/setup_od.sh
- name: Code checks
run: |
awk -f tools/indentation.awk **/*.dm
python3 tools/TagMatcher/tag-matcher.py ../..
python3 tools/GenerateChangelog/ss13_genchangelog.py html/changelog.html html/changelogs --dry-run
python3 tools/mapmerge2/travis_mapcheck.py
echo "6a5ae087fe5bfa66e52e508655e57120 *html/changelogs/example.yml" | md5sum -c -
- name: Run dreamchecker
id: runDreamchecker
run: ~/dreamchecker > ${GITHUB_WORKSPACE}/output-annotations.txt 2>&1
- name: Run OpenDream Lint
id: runOpenDreamLint
run: bash tools/ci/run_od.sh
- name: Annotate Lints
if: failure() && steps.runDreamchecker.outcome == 'failure'
uses: yogstation13/DreamAnnotate@v2
Expand Down
3 changes: 3 additions & 0 deletions aurorastation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
#define DEBUG
// END_PREFERENCES
// BEGIN_INCLUDE
#ifdef OPENDREAM
#include "code\___odlint.dm"
#endif
#include "code\global.dm"
#include "code\hub.dm"
#include "code\names.dm"
Expand Down
30 changes: 30 additions & 0 deletions code/___odlint.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#ifndef SPACEMAN_DMM

#pragma FileAlreadyIncluded error
#pragma MissingIncludedFile error
#pragma MisplacedDirective error
#pragma UndefineMissingDirective error
#pragma DefinedMissingParen error
#pragma ErrorDirective error
#pragma WarningDirective error
#pragma MiscapitalizedDirective error

//2000-2999
#pragma SoftReservedKeyword error
#pragma DuplicateVariable error
#pragma DuplicateProcDefinition error
#pragma TooManyArguments error
#pragma PointlessParentCall error
#pragma PointlessBuiltinCall error
#pragma SuspiciousMatrixCall error
#pragma MalformedRange error
#pragma InvalidRange error
#pragma InvalidSetStatement error
#pragma InvalidOverride error
#pragma DanglingVarType error
#pragma MissingInterpolatedExpression error

//3000-3999
#pragma EmptyBlock error

#endif
2 changes: 1 addition & 1 deletion code/_helpers/unsorted.dm
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,7 @@ var/list/wall_items = typecacheof(list(
// Returns a variable type as string, optionally with some details:
// Objects (datums) get their type, paths get the type name, scalars show length (text) and value (numbers), lists show length.
// Also attempts some detection of otherwise undetectable types using ref IDs
var/global/known_proc = new /proc/get_type_ref_bytes
var/global/known_proc = /proc/get_type_ref_bytes
/proc/get_debug_type(var/V, var/details = TRUE, var/print_numbers = TRUE, var/path_names = TRUE, var/text_lengths = TRUE, var/list_lengths = TRUE, var/show_useless_subtypes = TRUE)
// scalars / basic types
if(isnull(V))
Expand Down
33 changes: 16 additions & 17 deletions code/controllers/subsystems/initialization/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -98,25 +98,24 @@ var/datum/controller/subsystem/atoms/SSatoms
if(start_tick != world.time)
BadInitializeCalls[the_type] |= BAD_INIT_SLEPT

switch(result)
if(INITIALIZE_HINT_NORMAL)
// Pass
if(INITIALIZE_HINT_LATELOAD)
if(arguments[1]) //mapload
late_loaders += A
else
A.LateInitialize()
if(INITIALIZE_HINT_QDEL)
qdel(A)
return TRUE
if(INITIALIZE_HINT_LATEQDEL)
if(arguments[1]) //mapload
late_qdel += A
else
if(result !=INITIALIZE_HINT_NORMAL)
switch(result)
if(INITIALIZE_HINT_LATELOAD)
if(arguments[1]) //mapload
late_loaders += A
else
A.LateInitialize()
if(INITIALIZE_HINT_QDEL)
qdel(A)
return TRUE
else
BadInitializeCalls[the_type] |= BAD_INIT_NO_HINT
if(INITIALIZE_HINT_LATEQDEL)
if(arguments[1]) //mapload
late_qdel += A
else
qdel(A)
return TRUE
else
BadInitializeCalls[the_type] |= BAD_INIT_NO_HINT

if(!A) //possible harddel
return TRUE
Expand Down
2 changes: 1 addition & 1 deletion code/datums/mind.dm
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@
to_chat(H, "<span class='danger'><font size =3>You somehow have become the recipient of a loyalty transplant, and it just activated!</font></span>")
H.implant_loyalty(H, override = TRUE)
log_admin("[key_name_admin(usr)] has loyalty implanted [current].",admin_key=key_name(usr),ckey=key_name(usr))
else

else if (href_list["silicon"])
BITSET(current.hud_updateflag, SPECIALROLE_HUD)
switch(href_list["silicon"])
Expand Down
2 changes: 1 addition & 1 deletion code/defines/obj.dm
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
/obj/structure/spaceship
name = "Abandoned Shuttle"
desc = "An ancient and inoperable shuttle-craft"
icon = 'icons/obj/machinery/spaceship.dmi'
icon = 'icons/obj/machinery/SpaceShip.dmi'
anchored = 1
density = 1

Expand Down
2 changes: 0 additions & 2 deletions code/game/dna/dna_modifier.dm
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@
//SN src = null
qdel(src)
return
else
return

/obj/machinery/computer/scan_consolenew
Expand Down Expand Up @@ -253,7 +252,6 @@
//SN src = null
qdel(src)
return
else
return

/obj/machinery/computer/scan_consolenew/New()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,33 @@
// BEGIN RESEARCH DATUMS

/datum/malf_research_ability/interdiction/recall_shuttle
ability = new/datum/game_mode/malfunction/verb/recall_shuttle()
ability = /datum/game_mode/malfunction/verb/recall_shuttle
price = 75
next = new/datum/malf_research_ability/interdiction/unlock_cyborg()
next = /datum/malf_research_ability/interdiction/unlock_cyborg
name = "Recall Shuttle"


/datum/malf_research_ability/interdiction/unlock_cyborg
ability = new/datum/game_mode/malfunction/verb/unlock_cyborg()
ability = /datum/game_mode/malfunction/verb/unlock_cyborg
price = 1200
next = new/datum/malf_research_ability/interdiction/hack_drone()
next = /datum/malf_research_ability/interdiction/hack_drone
name = "Unlock Cyborg"

/datum/malf_research_ability/interdiction/hack_drone
ability = new/datum/game_mode/malfunction/verb/hack_drone()
ability = /datum/game_mode/malfunction/verb/hack_drone
price = 2500
next = new/datum/malf_research_ability/interdiction/hack_cyborg()
next = /datum/malf_research_ability/interdiction/hack_cyborg
name = "Hack maintenance drone"

/datum/malf_research_ability/interdiction/hack_cyborg
ability = new/datum/game_mode/malfunction/verb/hack_cyborg()
ability = /datum/game_mode/malfunction/verb/hack_cyborg
price = 3000
next = new/datum/malf_research_ability/interdiction/hack_ai()
next = /datum/malf_research_ability/interdiction/hack_ai
name = "Hack Cyborg"


/datum/malf_research_ability/interdiction/hack_ai
ability = new/datum/game_mode/malfunction/verb/hack_ai()
ability = /datum/game_mode/malfunction/verb/hack_ai
price = 7500
name = "Hack AI"

Expand Down Expand Up @@ -160,7 +160,7 @@
if(hacked_num >= config.hacked_drones_limit)
to_chat(user, SPAN_WARNING("ERROR: maximum active hacked drones limit reached. Report: [hacked_num] drones hacked out of [config.hacked_drones_limit] maximum possible."))
return

if(!ability_prechecks(user, price) || !ability_pay(user, price))
return
var/mob/living/silicon/robot/drone/D = pick(drone_list)
Expand Down Expand Up @@ -321,4 +321,4 @@
log_ability_use(user, "hack AI", target)


// END ABILITY VERBS
// END ABILITY VERBS
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,33 @@
// BEGIN RESEARCH DATUMS

/datum/malf_research_ability/manipulation/hack_holopad
ability = new/datum/game_mode/malfunction/verb/hack_holopad()
ability = /datum/game_mode/malfunction/verb/hack_holopad
price = 50
next = new/datum/malf_research_ability/manipulation/hack_camera()
next = /datum/malf_research_ability/manipulation/hack_camera
name = "Hack Holopad"


/datum/malf_research_ability/manipulation/hack_camera
ability = new/datum/game_mode/malfunction/verb/hack_camera()
ability = /datum/game_mode/malfunction/verb/hack_camera
price = 1200
next = new/datum/malf_research_ability/manipulation/emergency_forcefield()
next = /datum/malf_research_ability/manipulation/emergency_forcefield
name = "Hack Camera"


/datum/malf_research_ability/manipulation/emergency_forcefield
ability = new/datum/game_mode/malfunction/verb/emergency_forcefield()
ability = /datum/game_mode/malfunction/verb/emergency_forcefield
price = 1750
next = new/datum/malf_research_ability/manipulation/gravity_malfunction()
next = /datum/malf_research_ability/manipulation/gravity_malfunction
name = "Emergency Forcefield"

/datum/malf_research_ability/manipulation/gravity_malfunction
ability = new/datum/game_mode/malfunction/verb/gravity_malfunction()
ability = /datum/game_mode/malfunction/verb/gravity_malfunction
price = 2500
next = new/datum/malf_research_ability/manipulation/machine_overload()
next = /datum/malf_research_ability/manipulation/machine_overload
name = "Gravity Malfunction"

/datum/malf_research_ability/manipulation/machine_overload
ability = new/datum/game_mode/malfunction/verb/machine_overload()
ability = /datum/game_mode/malfunction/verb/machine_overload
price = 5000
name = "Machine Overload"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,26 @@
// BEGIN RESEARCH DATUMS

/datum/malf_research_ability/networking/basic_hack
ability = new/datum/game_mode/malfunction/verb/basic_encryption_hack()
ability = /datum/game_mode/malfunction/verb/basic_encryption_hack
price = 25
next = new/datum/malf_research_ability/networking/advanced_hack()
next = /datum/malf_research_ability/networking/advanced_hack
name = "Basic Encryption Hack"

/datum/malf_research_ability/networking/advanced_hack
ability = new/datum/game_mode/malfunction/verb/advanced_encryption_hack()
ability = /datum/game_mode/malfunction/verb/advanced_encryption_hack
price = 400
next = new/datum/malf_research_ability/networking/elite_hack()
next = /datum/malf_research_ability/networking/elite_hack
name = "Advanced Encryption Hack"

/datum/malf_research_ability/networking/elite_hack
ability = new/datum/game_mode/malfunction/verb/elite_encryption_hack()
ability = /datum/game_mode/malfunction/verb/elite_encryption_hack
price = 1000
next = new/datum/malf_research_ability/networking/system_override()
next = /datum/malf_research_ability/networking/system_override
name = "Elite Encryption Hack"


/datum/malf_research_ability/networking/system_override
ability = new/datum/game_mode/malfunction/verb/system_override()
ability = /datum/game_mode/malfunction/verb/system_override
price = 5000
name = "System Override"

Expand Down Expand Up @@ -143,7 +143,6 @@
var/resp = alert(usr, "Would you like it to appear as if CCIAMS made the report?",,"Yes","No")
if (resp == "Yes")
reportbody += "\n\n- CCIAMS, [commstation_name()]"
else

switch(alert("Should this be announced to the general population?",,"Yes","No"))
if("Yes")
Expand Down Expand Up @@ -289,7 +288,7 @@
user.hack_can_fail = 0
user.hacking = 0
user.system_override = 2
add_verb(user, new/datum/game_mode/malfunction/verb/ai_destroy_station())
add_verb(user, /datum/game_mode/malfunction/verb/ai_destroy_station)


// END ABILITY VERBS
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,28 @@
// BEGIN RESEARCH DATUMS

/datum/malf_research_ability/synthetic/reset_module
ability = new/datum/game_mode/malfunction/verb/reset_module()
ability = /datum/game_mode/malfunction/verb/reset_module
price = 100
next = new/datum/malf_research_ability/synthetic/infect_apc()
next = /datum/malf_research_ability/synthetic/infect_apc
name = "Reset Cyborg Module"


/datum/malf_research_ability/synthetic/infect_apc
ability = new/datum/game_mode/malfunction/verb/infect_apc()
ability = /datum/game_mode/malfunction/verb/infect_apc
price = 500
next = new/datum/malf_research_ability/synthetic/overclock_borg()
next = /datum/malf_research_ability/synthetic/overclock_borg
name = "Infect APC"


/datum/malf_research_ability/synthetic/overclock_borg
ability = new/datum/game_mode/malfunction/verb/overclock_borg()
ability = /datum/game_mode/malfunction/verb/overclock_borg
price = 1300
next = new/datum/malf_research_ability/synthetic/synthetic_takeover
next = /datum/malf_research_ability/synthetic/synthetic_takeover
name = "Overclock Cyborg"


/datum/malf_research_ability/synthetic/synthetic_takeover
ability = new/datum/game_mode/malfunction/verb/synthetic_takeover()
ability = /datum/game_mode/malfunction/verb/synthetic_takeover
price = 4000
name = "Synthetic Takeover"

Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/CableLayer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
m = min(m, cable.amount)
m = min(m, 30)
if(m)
playsound(loc, 'sound/items/wirecutter.ogg', 50, 1)
playsound(loc, 'sound/items/Wirecutter.ogg', 50, 1)
var/cable_color = use_cable(m)
var/obj/item/stack/cable_coil/CC = new(get_turf(src), m, cable_color)
user.put_in_hands(CC)
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/Sleeper.dm
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@
return TRUE

if(!istype(L))
to_chat(user, "<span class='warning'>\The machine won't accept that.</span>")
to_chat(user, "<span class='warning'>The machine won't accept that.</span>")
return TRUE

if(display_loading_message)
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/alarm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@

if (wiresexposed && W.iswirecutter())
user.visible_message("<span class='warning'>[user] has cut the wires inside \the [src]!</span>", "You cut the wires inside \the [src].")
playsound(src.loc, 'sound/items/wirecutter.ogg', 50, 1)
playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
new/obj/item/stack/cable_coil(get_turf(src), 5)
buildstage = 1
update_icon()
Expand Down
6 changes: 3 additions & 3 deletions code/game/machinery/camera/camera.dm
Original file line number Diff line number Diff line change
Expand Up @@ -232,15 +232,15 @@
visible_message("<span class='notice'> [user] has deactivated [src]!</span>")
else
visible_message("<span class='notice'> [src] clicks and shuts down. </span>")
playsound(src.loc, 'sound/items/wirecutter.ogg', 100, 1)
playsound(src.loc, 'sound/items/Wirecutter.ogg', 100, 1)
icon_state = "[initial(icon_state)]1"
add_hiddenprint(user)
else
if(user)
visible_message("<span class='notice'> [user] has reactivated [src]!</span>")
else
visible_message("<span class='notice'> [src] clicks and reactivates itself. </span>")
playsound(src.loc, 'sound/items/wirecutter.ogg', 100, 1)
playsound(src.loc, 'sound/items/Wirecutter.ogg', 100, 1)
icon_state = initial(icon_state)
add_hiddenprint(user)

Expand Down Expand Up @@ -367,7 +367,7 @@

// Do after stuff here
to_chat(user, "<span class='notice'>You start to weld the [src]..</span>")
playsound(src.loc, 'sound/items/welder.ogg', 50, 1)
playsound(src.loc, 'sound/items/Welder.ogg', 50, 1)
user.flash_act(FLASH_PROTECTION_MAJOR)
busy = 1
if(WT.use_tool(src, user, 100, volume = 50))
Expand Down
Loading

0 comments on commit 5e1332d

Please sign in to comment.