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

Fix: tickled files for modularity #11

Merged
merged 5 commits into from
Jul 12, 2023
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
4 changes: 3 additions & 1 deletion paradise.dme
Original file line number Diff line number Diff line change
Expand Up @@ -2673,5 +2673,7 @@
#include "goon\code\datums\browserOutput.dm"
#include "interface\interface.dm"
#include "interface\skin.dmf"
#include "modular_ss220\modular_ss220.dme" // SS220
// END_INCLUDE

// SS220
#include "modular_ss220\modular_ss220.dme"
10 changes: 8 additions & 2 deletions tools/ci/unticked_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@

IGNORE_FILES = {
# Included directly in the function /datum/tgs_api/v5#ApiVersion
'code/modules/tgs/v5/v5_interop_version.dm'
'code/modules/tgs/v5/v5_interop_version.dm',
# Example files. They should not be included in the build
'modular_ss220/example/code/example.dm',
'modular_ss220/example/_example.dm'
}

def get_unticked_files(root:Path):
Expand All @@ -35,8 +38,11 @@ def get_unticked_files(root:Path):
with open(root / includer, 'r') as f:
lines = [line for line in f.readlines() if line.startswith('#include')]
included = [line.replace('#include ', '').rstrip('\r\n').strip('"') for line in lines]
print(f'Found {len(included)} includes in {root / includer}')
nested_dmes = [file for file in included if ".dme" in file]
print(f'Found {len(included)} includes and {len(nested_dmes)} nested .dme\'s in {root / includer}')
ticked_files.update([root / Path(includer).parent / Path(PureWindowsPath(i)) for i in included])
if nested_dmes: print(f"Additional include files: {nested_dmes}")
INCLUDER_FILES.extend([file.replace("\\", "/") for file in nested_dmes])

all_dm_files = {f for f in root.glob('**/*.dm')}
return all_dm_files - ticked_files - {root / f for f in IGNORE_FILES}
Expand Down