style: apply ruff autoformat

This commit is contained in:
2025-12-17 16:37:21 +01:00
parent d5599ac1b8
commit 7123841fb4
268 changed files with 6194 additions and 4008 deletions

View File

@@ -3,6 +3,7 @@
CLI wrapper for Makefile targets within Infinito.Nexus.
Invokes `make` commands in the project root directory.
"""
import argparse
import os
import subprocess
@@ -11,31 +12,31 @@ import sys
def main():
parser = argparse.ArgumentParser(
prog='infinito make',
description='Run Makefile targets for Infinito.Nexus project'
prog="infinito make",
description="Run Makefile targets for Infinito.Nexus project",
)
parser.add_argument(
'targets',
"targets",
nargs=argparse.REMAINDER,
help='Make targets and options to pass to `make`'
help="Make targets and options to pass to `make`",
)
args = parser.parse_args()
# Default to 'build' if no target is specified
make_args = args.targets or ['build']
make_args = args.targets or ["build"]
# Determine repository root (one level up from cli/)
script_dir = os.path.dirname(os.path.realpath(__file__))
repo_root = os.path.abspath(os.path.join(script_dir, os.pardir))
# Check for Makefile
makefile_path = os.path.join(repo_root, 'Makefile')
makefile_path = os.path.join(repo_root, "Makefile")
if not os.path.isfile(makefile_path):
print(f"Error: Makefile not found in {repo_root}", file=sys.stderr)
sys.exit(1)
# Invoke make in repo root
cmd = ['make'] + make_args
cmd = ["make"] + make_args
try:
result = subprocess.run(cmd, cwd=repo_root)
sys.exit(result.returncode)
@@ -46,5 +47,5 @@ def main():
sys.exit(1)
if __name__ == '__main__':
if __name__ == "__main__":
main()