Skip to content

Commit

Permalink
Merge pull request #2 from AEV-Oxyd/update-linters
Browse files Browse the repository at this point in the history
Update linters
  • Loading branch information
MLGTASTICa authored Apr 3, 2024
2 parents 3a3473c + 08baf41 commit 1f417a8
Show file tree
Hide file tree
Showing 257 changed files with 2,423 additions and 7,456 deletions.
24 changes: 19 additions & 5 deletions .github/workflows/ci_suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,26 @@ jobs:
tools/build/build --ci lint tgui-test
tools/bootstrap/python -m dmi.test
tools/bootstrap/python -m mapmerge2.dmm_test
~/dreamchecker > ${GITHUB_WORKSPACE}/output-annotations.txt 2>&1
- name: Annotate Lints
uses: yogstation13/DreamAnnotate@v2
if: always()
~/dreamchecker 2>&1 | bash tools/ci/annotate_dm.sh
odlint:
if: ( !contains(github.event.head_commit.message, '[ci skip]') )
name: "Lint with OpenDream"
runs-on: ubuntu-22.04
concurrency:
group: odlint-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
- uses: robinraju/[email protected]
with:
outputFile: output-annotations.txt
repository: "OpenDreamProject/OpenDream"
tag: "latest"
fileName: "DMCompiler_linux-x64.tar.gz"
extract: true
- name: Run OpenDream
run: |
./DMCompiler_linux-x64/DMCompiler cev_eris.dme --suppress-unimplemented --define=CIBUILDING
compile_all_maps:
if: "!contains(github.event.head_commit.message, '[ci skip]')"
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -223,3 +223,6 @@ aux*.pdb
# Screenshot tests
/artifacts
yarn.lock

# Running OpenDream locally
tgstation.json
22 changes: 11 additions & 11 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "byond",
"request": "launch",
"name": "Launch and Build TGUI and DM",
"preLaunchTask": "TGUI Compile",
"dmb": "${workspaceFolder}/${command:CurrentDMB}"
},
]
}
"version": "0.2.0",
"configurations": [
{
"type": "byond",
"request": "launch",
"name": "Launch and Build TGUI and DM",
"preLaunchTask": "TGUI Compile",
"dmb": "${workspaceFolder}/${command:CurrentDMB}"
}
]
}
32 changes: 21 additions & 11 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "TGUI Compile",
"type": "shell",
"command": "bin/build.cmd",
"presentation": {"echo": true, "reveal": "always", "focus": false, "panel": "shared", "showReuseMessage": false, "clear": true},
"group": {"kind": "build", "isDefault": true},
}
]
}
"version": "2.0.0",
"tasks": [
{
"label": "TGUI Compile",
"type": "shell",
"command": "bin/build.cmd",
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared",
"showReuseMessage": false,
"clear": true
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
10 changes: 10 additions & 0 deletions __odlint.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// This file is included right at the start of the DME.
// Its purpose is to enable multiple lints (pragmas) that are supported by OpenDream to better validate the codebase
// These are essentially nitpicks the DM compiler should pick up on but doesnt

#if !defined(SPACEMAN_DMM) && defined(OPENDREAM)
// This is in a separate file as a hack to avoid SpacemanDMM
// evaluating the #pragma lines, even if its outside a block it cares about
// (Also so people can code-own it. Shoutout to AA)
#include "tools/ci/od_lints.dm"
#endif
32 changes: 4 additions & 28 deletions cev_eris.dme
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#define DEBUG
// END_PREFERENCES
// BEGIN_INCLUDE
#include "__odlint.dm"
#include "code\_compile_options.dm"
#include "code\_debugger.dm"
#include "code\client_macros.dm"
Expand Down Expand Up @@ -254,7 +255,6 @@
#include "code\controllers\subsystems\spawn_data.dm"
#include "code\controllers\subsystems\staverbs.dm"
#include "code\controllers\subsystems\sun.dm"
#include "code\controllers\subsystems\supply.dm"
#include "code\controllers\subsystems\tgui.dm"
#include "code\controllers\subsystems\throwing.dm"
#include "code\controllers\subsystems\ticker.dm"
Expand All @@ -270,7 +270,6 @@
#include "code\controllers\subsystems\processing\nano.dm"
#include "code\controllers\subsystems\processing\objs.dm"
#include "code\controllers\subsystems\processing\processing.dm"
#include "code\controllers\subsystems\processing\projectiles.dm"
#include "code\controllers\subsystems\processing\turf.dm"
#include "code\controllers\subsystems\processing\organs\internal_wounds.dm"
#include "code\controllers\subsystems\tickets\mentor_tickets.dm"
Expand Down Expand Up @@ -546,7 +545,6 @@
#include "code\game\shuttle_engines.dm"
#include "code\game\skincmd.dm"
#include "code\game\sound.dm"
#include "code\game\supplyshuttle.dm"
#include "code\game\world.dm"
#include "code\game\antagonist\_antagonist_setup.dm"
#include "code\game\antagonist\antagonist.dm"
Expand Down Expand Up @@ -624,7 +622,6 @@
#include "code\game\gamemodes\events\hidden_events\bluespace_rift.dm"
#include "code\game\gamemodes\events\hidden_events\kaiser.dm"
#include "code\game\gamemodes\events\holidays\Christmas.dm"
#include "code\game\gamemodes\events\holidays\Holidays.dm"
#include "code\game\gamemodes\events\weather\rad_storm.dm"
#include "code\game\gamemodes\malfunction\malf_hardware.dm"
#include "code\game\gamemodes\malfunction\malf_research.dm"
Expand Down Expand Up @@ -726,7 +723,6 @@
#include "code\game\machinery\status_display.dm"
#include "code\game\machinery\status_display_ai.dm"
#include "code\game\machinery\suit_storage_unit.dm"
#include "code\game\machinery\supply_display.dm"
#include "code\game\machinery\supplybeacon.dm"
#include "code\game\machinery\surveillance_pod.dm"
#include "code\game\machinery\teleporter.dm"
Expand Down Expand Up @@ -950,10 +946,6 @@
#include "code\game\objects\items\devices\organ_module\active\multitool\miner.dm"
#include "code\game\objects\items\devices\organ_module\passive\armor.dm"
#include "code\game\objects\items\devices\organ_module\passive\muscle.dm"
#include "code\game\objects\items\devices\PDA\cart.dm"
#include "code\game\objects\items\devices\PDA\chatroom.dm"
#include "code\game\objects\items\devices\PDA\PDA.dm"
#include "code\game\objects\items\devices\PDA\radio.dm"
#include "code\game\objects\items\devices\radio\beacon.dm"
#include "code\game\objects\items\devices\radio\electropack.dm"
#include "code\game\objects\items\devices\radio\encryptionkey.dm"
Expand Down Expand Up @@ -1500,22 +1492,6 @@
#include "code\modules\bs_snare\circuits.dm"
#include "code\modules\bs_snare\machinery.dm"
#include "code\modules\bs_snare\snare.dm"
#include "code\modules\cargo\exports.dm"
#include "code\modules\cargo\order.dm"
#include "code\modules\cargo\packs.dm"
#include "code\modules\cargo\supplyshuttle.dm"
#include "code\modules\cargo\exports\gear.dm"
#include "code\modules\cargo\exports\large_objects.dm"
#include "code\modules\cargo\exports\manifest.dm"
#include "code\modules\cargo\exports\medical_shit.dm"
#include "code\modules\cargo\exports\misc.dm"
#include "code\modules\cargo\exports\money.dm"
#include "code\modules\cargo\exports\parts.dm"
#include "code\modules\cargo\exports\research.dm"
#include "code\modules\cargo\exports\rnd_shit.dm"
#include "code\modules\cargo\exports\sheets.dm"
#include "code\modules\cargo\exports\tools.dm"
#include "code\modules\cargo\exports\weapons.dm"
#include "code\modules\client\client_defines.dm"
#include "code\modules\client\client_procs.dm"
#include "code\modules\client\darkmode.dm"
Expand Down Expand Up @@ -1805,7 +1781,6 @@
#include "code\modules\long_range_scanner\long_range_scanner.dm"
#include "code\modules\maps\dmm_suite.dm"
#include "code\modules\maps\swapmaps.dm"
#include "code\modules\maps\writer.dm"
#include "code\modules\maps\tg\map_template.dm"
#include "code\modules\maps\tg\reader.dm"
#include "code\modules\materials\material_decs.dm"
Expand Down Expand Up @@ -1865,6 +1840,7 @@
#include "code\modules\mining\money_bag.dm"
#include "code\modules\mining\ore.dm"
#include "code\modules\mining\ore_datum.dm"
#include "code\modules\mining\plasticflaps.dm"
#include "code\modules\mining\satchel_ore_boxdm.dm"
#include "code\modules\mining\drilling\cave_generator.dm"
#include "code\modules\mining\drilling\cave_mineral.dm"
Expand Down Expand Up @@ -2344,6 +2320,8 @@
#include "code\modules\organs\internal\stomach.dm"
#include "code\modules\organs\internal\internal_wounds\_internal_wound.dm"
#include "code\modules\organs\internal\internal_wounds\bone.dm"
#include "code\modules\organs\internal\internal_wounds\brain.dm"
#include "code\modules\organs\internal\internal_wounds\eyes.dm"
#include "code\modules\organs\internal\internal_wounds\organic.dm"
#include "code\modules\organs\internal\internal_wounds\robotic.dm"
#include "code\modules\organs\internal\internal_wounds\sanity.dm"
Expand Down Expand Up @@ -2375,7 +2353,6 @@
#include "code\modules\overmap\ships\engines\thermal.dm"
#include "code\modules\paperwork\carbonpaper.dm"
#include "code\modules\paperwork\clipboard.dm"
#include "code\modules\paperwork\faxmachine.dm"
#include "code\modules\paperwork\filingcabinet.dm"
#include "code\modules\paperwork\folders.dm"
#include "code\modules\paperwork\handlabeler.dm"
Expand Down Expand Up @@ -2700,7 +2677,6 @@
#include "code\modules\shuttles\shuttle_emergency.dm"
#include "code\modules\shuttles\shuttle_ferry.dm"
#include "code\modules\shuttles\shuttle_specops.dm"
#include "code\modules\shuttles\shuttle_supply.dm"
#include "code\modules\shuttles\shuttles_multi.dm"
#include "code\modules\sprite_accessories\_accessory.dm"
#include "code\modules\sprite_accessories\_accessory_facial.dm"
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/chemistry.dm
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
#define CE_DYNAMICFINGERS "dynamic fingers"
#define CE_BONE_MEND "bone mending" // Ossisine
#define CE_ONCOCIDAL "anticancer"
#define CE_BRAINHEAL "neural tissue restoration"
#define CE_EYEHEAL "sensory organ regeneration stimulant"

// Chem effects for robotic/assisted organs
#define CE_MECH_STABLE "cooling"
Expand Down
4 changes: 4 additions & 0 deletions code/__DEFINES/dcs/helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@

/// A wrapper for _LoadComponent that allows us to pretend we're using normal named arguments
#define LoadComponent(arguments...) _LoadComponent(list(##arguments))

/// A null statement to guard against EmptyBlock lint without necessitating the use of pass()
/// Used to avoid proc-call overhead. But use sparingly. Probably pointless in most places.
#define EMPTY_BLOCK_GUARD ;
2 changes: 1 addition & 1 deletion code/__DEFINES/dcs/signals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@

// /mob/living signals
#define COMSIG_LIVING_STUN_EFFECT "stun_effect_act" //mob/living/proc/stun_effect_act()
#define COMSIG_CARBON_HAPPY "carbon_happy" //drugs o ethanol in blood
#define COMSIG_CARBON_HAPPY "carbon_happy" //drugs or ethanol in blood

// /mob/living/carbon signals
#define COMSIG_CARBON_ELECTROCTE "carbon_electrocute act" //mob/living/carbon/electrocute_act()
Expand Down
9 changes: 9 additions & 0 deletions code/__DEFINES/spawner/_spawner.dm
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,15 @@
#define SPAWN_TAG_MEDICINE_CONTRABAND SPAWN_TAG_MEDICINE+";"+SPAWN_CONTRABAND
#define SPAWN_TAG_MEDICINE_ADVANCED SPAWN_TAG_MEDICINE+";"+SPAWN_MEDICINE_ADVANCED

//ITEMS - DRUGS
#define SPAWN_DRUG "drug"
#define SPAWN_CIGARETTE "cigarettes"
#define SPAWN_CIGARETTE_MAINTS "maint cigarettes"

#define SPAWN_TAG_DRUG SPAWN_TAG_ITEM+";"+SPAWN_DRUG
#define SPAWN_TAG_CIGARETTE SPAWN_TAG_DRUG+";"+SPAWN_CIGARETTE
#define SPAWN_TAG_CIGARETTE_MAINTS SPAWN_TAG_DRUG+";"+SPAWN_CIGARETTE_MAINTS

//ITEMS - BEAKER
#define SPAWN_TAG_VIAL SPAWN_TAG_ITEM+";"+SPAWN_SCIENCE+";"+SPAWN_MEDICAL+";beaker;vial"

Expand Down
3 changes: 0 additions & 3 deletions code/__HELPERS/_logging.dm
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,6 @@
if (config.log_adminwarn)
game_log("ADMINWARN", text)

/proc/log_pda(text)
if (config.log_pda)
game_log("PDA", text)

/**
* Appends a tgui-related log entry. All arguments are optional.
Expand Down
1 change: 1 addition & 0 deletions code/__HELPERS/artwork_names.dm
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ GLOBAL_LIST_INIT(art_description_types_statue, file2list("strings/artist_strings
var/description_artwork_statue = pick(description_artwork_statue_verb,description_artwork_statue_stationary)

var/description_statue = "[description_artwork_statue] [get_artwork_description()]"
description_statue += qualitydesc
desc += " [description_statue]"
return description_statue

Expand Down
3 changes: 2 additions & 1 deletion code/__HELPERS/global_lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ var/global/list/organ_tag_to_name = list(
groin = "groin",l_leg = "left leg",
chest2= "back", heart = "heart",
lungs = "lungs", liver = "liver",
"left kidney" = "left kidney", "right kidney" = "right kidney",
"left kidney" = "left kidney",
"right kidney" = "right kidney",
stomach = "stomach", brain = "brain"
)

Expand Down
57 changes: 0 additions & 57 deletions code/__HELPERS/names.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,63 +17,6 @@ var/command_name
/proc/system_name()
return "Nyx"

/proc/station_name()
if (station_name)
return station_name

var/random = rand(1, 5)
var/name = ""

//Rare: Pre-Prefix
if (prob(10))
name = pick("Imperium", "Heretical", "Cuban", "Psychic", "Elegant", "Common", "Uncommon", "Rare", "Unique", "Houseruled", "Religious", "Atheist", "Traditional", "Houseruled", "Mad", "Super", "Ultra", "Secret", "Top Secret", "Deep", "Death", "Zybourne", "Central", "Main", "Government", "Uoi", "Fat", "Automated", "Experimental", "Augmented")
station_name = name + " "

// Prefix
switch(Holiday)
//get normal name
if(null, "", 0)
name = pick("", "Stanford", "Dorf", "Alium", "Prefix", "Clowning", "Aegis", "Ishimura", "Scaredy", "Death-World", "Mime", "Honk", "Rogue", "MacRagge", "Ultrameens", "Safety", "Paranoia", "Explosive", "Neckbear", "Donk", "Muppet", "North", "West", "East", "South", "Slant-ways", "Widdershins", "Rimward", "Expensive", "Procreatory", "Imperial", "Unidentified", "Immoral", "Carp", "Ork", "Pete", "Control", "Nettle", "Aspie", "Class", "Crab", "Fist", "Corrogated", "Skeleton", "Race", "Fatguy", "Gentleman", "Capitalist", "Communist", "Bear", "Beard", "Derp", "Space", "Spess", "Star", "Moon", "System", "Mining", "Neckbeard", "Research", "Supply", "Military", "Orbital", "Battle", "Science", "Asteroid", "Home", "Production", "Transport", "Delivery", "Extraplanetary", "Orbital", "Correctional", "Robot", "Hats", "Pizza")
if(name)
station_name += name + " "

//For special days like christmas, easter, new-years etc ~Carn
if("Friday the 13th")
name = pick("Mike", "Friday", "Evil", "Myers", "Murder", "Deathly", "Stabby")
station_name += name + " "
random = 13
else
//get the first word of the Holiday and use that
var/i = findtext(Holiday, " ", 1, 0)
name = copytext(Holiday, 1, i)
station_name += name + " "

// Suffix
name = pick("Station", "Fortress", "Frontier", "Suffix", "Death-trap", "Space-hulk", "Lab", "Hazard", "Spess Junk", "Fishery", "No-Moon", "Tomb", "Crypt", "Hut", "Monkey", "Bomb", "Trade Post", "Fortress", "Village", "Town", "City", "Edition", "Hive", "Complex", "Base", "Facility", "Depot", "Outpost", "Installation", "Drydock", "Observatory", "Array", "Relay", "Monitor", "Platform", "Construct", "Hangar", "Prison", "Center", "Port", "Waystation", "Factory", "Waypoint", "Stopover", "Hub", "HQ", "Office", "Object", "Fortification", "Colony", "Planet-Cracker", "Roost", "Fat Camp")
station_name += name + " "

// ID Number
switch(random)
if(1)
station_name += "[rand(1, 99)]"
if(2)
station_name += pick("Alpha", "Beta", "Gamma", "Delta", "Epsilon", "Zeta", "Eta", "Theta", "Iota", "Kappa", "Lambda", "Mu", "Nu", "Xi", "Omicron", "Pi", "Rho", "Sigma", "Tau", "Upsilon", "Phi", "Chi", "Psi", "Omega")
if(3)
station_name += pick("II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X", "XI", "XII", "XIII", "XIV", "XV", "XVI", "XVII", "XVIII", "XIX", "XX")
if(4)
station_name += pick("Alpha", "Bravo", "Charlie", "Delta", "Echo", "Foxtrot", "Golf", "Hotel", "India", "Juliet", "Kilo", "Lima", "Mike", "November", "Oscar", "Papa", "Quebec", "Romeo", "Sierra", "Tango", "Uniform", "Victor", "Whiskey", "X-ray", "Yankee", "Zulu")
if(5)
station_name += pick("One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen")
if(13)
station_name += pick("13", "XIII", "Thirteen")


if (config && config.server_name)
world.name = "[config.server_name]: [name]"
else
world.name = station_name

return station_name

/proc/world_name(var/name)

Expand Down
2 changes: 1 addition & 1 deletion code/__HELPERS/text.dm
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ proc/TextPreview(var/string, var/len=40)
//For generating neat chat tag-images
//The icon var could be local in the proc, but it's a waste of resources
// to always create it and then throw it out.
/var/icon/text_tag_icons = new('./icons/chattags.dmi')
/var/icon/text_tag_icons = new('icons/chattags.dmi')
/proc/create_text_tag(var/tagname, var/tagdesc = tagname, var/client/C = null)
if(!(C && C.get_preference_value(/datum/client_preference/chat_tags) == GLOB.PREF_SHOW))
return tagdesc
Expand Down
5 changes: 3 additions & 2 deletions code/__HELPERS/turfs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@
//Used for clicks on blackspace
/proc/screen_loc2turf(text, turf/origin)
if(!origin)
return null
return
var/tZ = splittext(text, ",")
var/tX = splittext(tZ[1], "-")
var/tY = text2num(tX[2])
Expand All @@ -255,4 +255,5 @@
tZ = origin.z
tX = max(1, min(origin.x + 7 - tX, world.maxx))
tY = max(1, min(origin.y + 7 - tY, world.maxy))
return locate(tX, tY, tZ)
return (locate(tX, tY, tZ))

Loading

0 comments on commit 1f417a8

Please sign in to comment.