Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Splurt checks #16

Merged
merged 3 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci_suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ jobs:
run: |
bash tools/ci/check_grep.sh
bash skyrat/tools/skyrat_check_grep.sh # SKYRAT EDIT ADDITION - checking modular_skyrat code
bash modular_zzplurt/tools/ci/splurt_check_grep.sh # SPLURT EDIT ADDITION - checking modular_zzplurt code
- name: Ticked File Enforcement
if: steps.linter-setup.conclusion == 'success' && !cancelled()
run: |
Expand Down
Empty file.
12 changes: 12 additions & 0 deletions modular_zzplurt/tools/ci/splurt_check_grep.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

#ANSI Escape Codes for colors to increase contrast of errors
RED="\033[0;31m"
GREEN="\033[0;32m"
BLUE="\033[0;34m"
NC="\033[0m" # No Color

echo -e "${BLUE}Re-running grep checks, but looking in modular_zzplurt...${NC}"

# Run the linters again, but modular splurt code.
sed "s|code/\*\*/\*\.dm|modular_zzplurt/\*\*/\*\.dm|g" <tools/ci/check_grep.sh | bash
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,7 @@
#include "code\__DEFINES\~~bubber_defines\transport.dm"
#include "code\__DEFINES\~~bubber_defines\___HELPERS\global_lists.dm"
#include "code\__DEFINES\~~bubber_defines\research\techweb_nodes.dm"
#include "code\__DEFINES\~~~splurt_defines\traits\declarations.dm"
#include "code\__HELPERS\_auxtools_api.dm"
#include "code\__HELPERS\_lists.dm"
#include "code\__HELPERS\_planes.dm"
Expand Down
5 changes: 4 additions & 1 deletion tools/WebhookProcessor/github_webhook_processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@
"tgstation",
"TerraGov-Marine-Corps",
// ORIGINAL END - SKYRAT EDIT: */
"Skyrat-tg",
// SPLURT EDIT - We'll use our repo
//"Skyrat-tg",
"S.P.L.U.R.T-tg",
// SPLURT EDIT END
);

// Any repository that matches in this blacklist will not appear on Discord.
Expand Down
1 change: 1 addition & 0 deletions tools/build/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ export const DmTarget = new Juke.Target({
'interface/**',
'modular_skyrat/**', ///SKYRAT EDIT ADDITION - Making the CBT work
'modular_zubbers/**', ///BUBBER EDIT ADDITION - Making the CBT work
'modular_splurt/**', ///SPLURT EDIT ADDITION - Making the CBT work
`${DME_NAME}.dme`,
NamedVersionFile,
],
Expand Down
7 changes: 7 additions & 0 deletions tools/ticked_file_enforcement/schemas/modular_splurt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"file": "tgstation.dme",
"scannable_directory": "modular_zzplurt/",
"subdirectories": true,
"excluded_files": [],
"forbidden_includes": []
}
3 changes: 2 additions & 1 deletion tools/ticked_file_enforcement/schemas/tgstation_dme.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"forbidden_includes": [
"code/modules/tgs/**/*.dm",
"code/modules/unit_tests/[!_]*.dm",
"code/modules/unit_tests/~skyrat/[!_]*.dm"
"code/modules/unit_tests/~skyrat/[!_]*.dm",
"code/modules/unit_tests/~splurt/[!_]*.dm"
]
}
34 changes: 34 additions & 0 deletions tools/trait_validity/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def red(text):

defines_file = "code/__DEFINES/traits/declarations.dm"
skyrat_defines_file = "code/__DEFINES/~skyrat_defines/traits/declarations.dm" # SKYRAT EDIT ADDITION
splurt_defines_file = "code/__DEFINES/~~~splurt_defines/traits/declarations.dm" # SPLURT EDIT ADDITION
globalvars_file = "code/_globalvars/traits/_traits.dm"

how_to_fix_message = f"Please ensure that all traits in the {defines_file} file are added in the {globalvars_file} file."
Expand All @@ -37,6 +38,12 @@ def post_error(define_name):
sys.exit(1)
# SKYRAT EDIT ADDITION END

# SPLURT EDIT ADDITION START
if not os.path.isfile(splurt_defines_file):
print(red(f"Could not find the splurt defines file '{splurt_defines_file}'!"))
sys.exit(1)
# SPLURT EDIT ADDITION END

if not os.path.isfile(globalvars_file):
print(red(f"Could not find the globalvars file '{globalvars_file}'!"))
sys.exit(1)
Expand Down Expand Up @@ -96,6 +103,33 @@ def post_error(define_name):
defines_to_search_for.append(match.group(2))
# SKYRAT EDIT ADDITION END

# SPLURT EDIT ADDITION START
scannable_lines = []
with open(splurt_defines_file, 'r') as file:
reading = False

for line in file:
line = line.strip()

if line == "// BEGIN TRAIT DEFINES":
reading = True
continue
elif line == "// END TRAIT DEFINES":
break
elif not reading:
continue

scannable_lines.append(line)

for potential_define in scannable_lines:
match = define_regex.match(potential_define)
if not match:
continue

number_of_defines += 1
defines_to_search_for.append(match.group(2))
# SPLURT EDIT ADDITION END

if number_of_defines == 0:
print(red("No defines found! This is likely an error."))
sys.exit(1)
Expand Down
Loading