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

CI: Improved check for gamefix filenames #126

Merged
merged 3 commits into from
Sep 10, 2024
Merged
Changes from 1 commit
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
13 changes: 10 additions & 3 deletions .github/scripts/check_gamefixes.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,15 +188,22 @@ def check_filenames(root: Path) -> None:
file
for file in root.glob('gamefixes-*/*.py')
if not file.name.startswith(('__init__.py', 'default.py', 'winetricks-gui.py'))
and not file.parent.name.startswith('gamefixes-steam')
]

print('Checking for expected file names...', file=sys.stderr)
for module in gamefixes:
print(f'{module.parent.name}/{module.name}', file=sys.stderr)
if module.exists() and not module.name.startswith('umu-'):
err = f'The following file does not start with "umu-": {module}'
if not module.exists():
err = f'The following file does not exist: {module.parent.name}/{module}'
raise FileNotFoundError(err)
elif module.parent.name.startswith('gamefixes-steam'):
Root-Core marked this conversation as resolved.
Show resolved Hide resolved
if module.stem.isnumeric():
continue
err = f'The following Steam fix filename is invalid: {module}'
raise ValueError(err)
elif not module.name.startswith('umu-'):
err = f'The following file does not start with "umu-": {module}'
raise ValueError(err)


def main() -> None:
Expand Down