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

Система тестов для модульных файлов (раунд 2) #140

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
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
6 changes: 4 additions & 2 deletions .github/workflows/ci_suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,15 @@ jobs:
run: ':'
- name: Run Grep Checks
if: steps.linter-setup.conclusion == 'success' && !cancelled()
run: bash tools/ci/check_grep.sh
run: |
bash tools/ci/check_grep.sh
bash massmeta/tools/massmeta_check_grep.sh # MASSMETA EDIT ADDITION - checking modular_meta code
- name: Ticked File Enforcement
if: steps.linter-setup.conclusion == 'success' && !cancelled()
run: |
bash tools/massmeta_check_grep.sh # MASSMETA EDIT ADDITION - checking modular_meta code
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_meta.json # MASSMETA EDIT ADDITION - modular tick enforcement
- name: Check Define Sanity
if: steps.linter-setup.conclusion == 'success' && !cancelled()
run: tools/bootstrap/python -m define_sanity.check
Expand Down
23 changes: 11 additions & 12 deletions massmeta/modular_meta.dm
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/*
*
* Это основной файл куда будут складываться все наши модульные добавления.
* Добавлять только:
* Модули (.dm файлами)
* Сам этот файл добавлен в tgstation.dme
*
*Все Defines файлы лежат в папке "~meta_defines\", однако там идет переопределение пути для того чтобы не ругались тесты.
*
*/
// Это основной файл куда будут складываться все наши модульные добавления.
// Добавлять только:
// Модули (includes.dm файлами)
// Сам этот файл добавлен в tgstation.dme

//modular files
// Все Defines файлы лежат в папке "~meta_defines\", однако там идет переопределение пути для того чтобы не ругались тесты.


// Modular files (covered with tests)
// BEGIN_INCLUDE
#include "features\additional_circuit\includes.dm"
// END_INCLUDE


//master files (unsorted, TODO: need modularization)
Expand Down Expand Up @@ -84,7 +84,6 @@
#include "code\modules\cargo\packs\imports.dm"

//features
#include "features\additional_circuit\includes.dm"
#include "features\hardsuits\code\_jetpack.dm"
#include "features\hardsuits\code\armor.dm"
#include "features\hardsuits\code\hardsuit.dm"
Expand Down
File renamed without changes.
7 changes: 7 additions & 0 deletions tools/ticked_file_enforcement/schemas/modular_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"file": "massmeta/modular_meta.dm",
"scannable_directory": "massmeta/",
"subdirectories": true,
"excluded_files": [],
"forbidden_includes": []
}
18 changes: 18 additions & 0 deletions tools/ticked_file_enforcement/ticked_file_enforcement.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,25 @@ def post_error(string):
elif not reading:
continue

# MASSMETA EDIT ADDITION START (check modular code folder)
if scannable_directory == "massmeta/":
line = line[:10] + "massmeta\\" + line[10:]
# MASSMETA EDIT ADDITION END
lines.append(line)
# MASSMETA EDIT ADDITION START (check modular code folder)
# also add each modules files to futher check
if scannable_directory == "massmeta/":
print(f"Getting module files from:")
for module_file in lines:
module_file_path = module_file.replace('\\', '/')
module_file_path[10:(len(module_file) - 1]
print(f" {module_file} with:")
with open(module_file_path, 'r') as extra_file:
for extra_line in extra_file:
# all include files in each module must be "includes.dm" = 11 length
lines.append(module_file[:(len(module_file) - 11)] + extra_line[10:])
print(f" {module_file[:(len(module_file) - 11)] + extra_line[10:]}")
# MASSMETA EDIT ADDITION END

offset = total - len(lines)
print(blue(f"Ticked File Enforcement: {offset} lines were ignored in output for [{file_reference}]."))
Expand Down