Bubber CI checks (#1830)

<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request
Adds support for bubber-related code for the CI checks
<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

<!-- Please make sure to actually test your PRs. If you have not tested
your PR mention it. -->

## Why It's Good For The Game
Helps ensure code sanity.
<!-- Argue for the merits of your changes and how they benefit the game,
especially if they are controversial and/or far reaching. If you can't
actually explain WHY what you are doing will improve the game, then it
probably isn't good for the game in the first place. -->

## Proof Of Testing
CI checks
<!-- Compile and run your code locally. Make sure it works. This is the
place to show off your changes! We are not responsible for testing your
features. -->

---------

Co-authored-by: BongaTheProto <93835010+BongaTheProto@users.noreply.github.com>
Co-authored-by: Swift <jackwars4@gmail.com>
Co-authored-by: The Sharkening <95130227+StrangeWeirdKitten@users.noreply.github.com>
Co-authored-by: SkyratBot <59378654+SkyratBot@users.noreply.github.com>
Co-authored-by: Kyle Spier-Swenson <kyleshome@gmail.com>
Co-authored-by: thegrb93 <grbrown93@sbcglobal.net>
Co-authored-by: SpaceLoveSs13 <68121607+SpaceLoveSs13@users.noreply.github.com>
Co-authored-by: projectkepler-RU <99981766+projectkepler-ru@users.noreply.github.com>
Co-authored-by: Bubberbot <151680451+Bubberbot@users.noreply.github.com>
Co-authored-by: lessthanthree <83487515+lessthnthree@users.noreply.github.com>
Co-authored-by: Shadow-Quill <44811257+Shadow-Quill@users.noreply.github.com>
Co-authored-by: KathrinBailey <53862927+KathrinBailey@users.noreply.github.com>
Co-authored-by: Waterpig <49160555+Majkl-J@users.noreply.github.com>
Co-authored-by: snailomi <148835423+snailomi@users.noreply.github.com>
Co-authored-by: Cursor <102828457+theselfish@users.noreply.github.com>
Co-authored-by: Lutowski <136726218+Lutowski@users.noreply.github.com>
Co-authored-by: nevimer <77420409+nevimer@users.noreply.github.com>
This commit is contained in:
Mosley
2024-08-20 23:09:56 -04:00
committed by GitHub
co-authored by BongaTheProto Swift The Sharkening SkyratBot Kyle Spier-Swenson thegrb93 SpaceLoveSs13 projectkepler-RU Bubberbot lessthanthree Shadow-Quill KathrinBailey Waterpig snailomi Cursor Lutowski nevimer
parent 8b7015bc10
commit 45a373cdfa
9 changed files with 66 additions and 9 deletions
+2
View File
@@ -74,12 +74,14 @@ jobs:
run: |
bash tools/ci/check_grep.sh
bash skyrat/tools/skyrat_check_grep.sh # SKYRAT EDIT ADDITION - checking modular_skyrat code
bash modular_zubbers/tools/ci/zubbers_check_grep.sh # BUBBER EDIT ADDITION - checking modular_zubbers code
- name: Ticked File Enforcement
if: steps.linter-setup.conclusion == 'success' && !cancelled()
run: |
tools/bootstrap/python tools/ticked_file_enforcement/ticked_file_enforcement.py < tools/ticked_file_enforcement/schemas/tgstation_dme.json
tools/bootstrap/python tools/ticked_file_enforcement/ticked_file_enforcement.py < tools/ticked_file_enforcement/schemas/unit_tests.json
tools/bootstrap/python tools/ticked_file_enforcement/ticked_file_enforcement.py < tools/ticked_file_enforcement/schemas/modular_skyrat.json # SKYRAT EDIT ADDITION - modular tick enforcement
tools/bootstrap/python tools/ticked_file_enforcement/ticked_file_enforcement.py < tools/ticked_file_enforcement/schemas/modular_zubbers.json # BUBBER EDIT ADDITION - modular tick enforcement
- name: Check Define Sanity
if: steps.linter-setup.conclusion == 'success' && !cancelled()
run: tools/bootstrap/python -m define_sanity.check
@@ -1,7 +0,0 @@
/datum/material/silver/on_applied(atom/source, amount, material_flags)
. = ..()
source.AddElement(/datum/element/bane, mob_biotypes = MOB_VAMPIRIC, damage_multiplier = 0.5)
/datum/material/silver/on_removed(atom/source, amount, material_flags)
. = ..()
source.RemoveElement(/datum/element/bane)
@@ -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_zubbers...${NC}"
# Run the linters again, but modular zubbers code.
sed "s|code/\*\*/\*\.dm|modular_zubbers/\*\*/\*\.dm|g" <tools/ci/check_grep.sh | bash
+1 -1
View File
@@ -505,10 +505,10 @@
#include "code\__DEFINES\~~bubber_defines\species.dm"
#include "code\__DEFINES\~~bubber_defines\status_indicator_defines.dm"
#include "code\__DEFINES\~~bubber_defines\storyteller_defines.dm"
#include "code\__DEFINES\~~bubber_defines\traits.dm"
#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\~~bubber_defines\traits\declarations.dm"
#include "code\__HELPERS\_auxtools_api.dm"
#include "code\__HELPERS\_lists.dm"
#include "code\__HELPERS\_planes.dm"
+3
View File
@@ -33,5 +33,8 @@ def get_initial_schema_path():
def get_modular_schema_path():
return get_root_path() / 'SQL' / 'skyrat_schema.sql'
def get_bubber_schema_path():
return get_root_path() / 'SQL' / 'bubber_schema.sql'
def get_changelog_path():
return get_root_path() / 'SQL' / 'database_changelog.md'
+5 -1
View File
@@ -2,7 +2,7 @@ from contextlib import closing
from ..ezdb.changes import get_current_version
from ..ezdb.config import read_config
from ..ezdb.mysql import execute_sql, insert_new_schema_query, open_connection, start_daemon
from ..ezdb.paths import get_initial_schema_path, get_modular_schema_path
from ..ezdb.paths import get_initial_schema_path, get_modular_schema_path, get_bubber_schema_path
from .step import Step
class InstallInitialSchema(Step):
@@ -55,3 +55,7 @@ class InstallInitialSchema(Step):
with open(get_modular_schema_path(), 'r') as file:
schema = file.read()
execute_sql(schema)
with open(get_bubber_schema_path(), 'r') as file:
schema = file.read()
execute_sql(schema)
@@ -0,0 +1,7 @@
{
"file": "tgstation.dme",
"scannable_directory": "modular_zubbers/",
"subdirectories": true,
"excluded_files": [],
"forbidden_includes": []
}
+36
View File
@@ -15,6 +15,7 @@ on_github = os.getenv("GITHUB_ACTIONS") == "true"
defines_file = "code/__DEFINES/traits/declarations.dm"
skyrat_defines_file = "code/__DEFINES/~skyrat_defines/traits/declarations.dm" # SKYRAT EDIT ADDITION
bubber_defines_file = "code/__DEFINES/~~bubber_defines/traits/declarations.dm" # BUBBER 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."
@@ -37,6 +38,12 @@ if not os.path.isfile(skyrat_defines_file):
sys.exit(1)
# SKYRAT EDIT ADDITION END
# BUBBER EDIT ADDITION START
if not os.path.isfile(bubber_defines_file):
print(red(f"Could not find the bubber defines file '{bubber_defines_file}'!"))
sys.exit(1)
# BUBBER EDIT ADDITION END
if not os.path.isfile(globalvars_file):
print(red(f"Could not find the globalvars file '{globalvars_file}'!"))
sys.exit(1)
@@ -96,6 +103,35 @@ for potential_define in scannable_lines:
defines_to_search_for.append(match.group(2))
# SKYRAT EDIT ADDITION END
# BUBBER EDIT ADDITION START
scannable_lines = []
with open(bubber_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 "//" in line or "#define" not in line:
continue
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))
# BUBBER EDIT ADDITION END
if number_of_defines == 0:
print(red("No defines found! This is likely an error."))
sys.exit(1)