diff --git a/tasks.py b/tasks.py index c5106d0..0c5fe52 100644 --- a/tasks.py +++ b/tasks.py @@ -96,60 +96,6 @@ def format(c): c.run("pre-commit run --all-files", pty=True) -@task -def format_check(c): - """Check if all files are formatted correctly""" - missing_tools = [] - format_errors = [] - - print("Checking C file formatting...") - result = c.run( - "find main components -name '*.c' -o -name '*.h' | xargs clang-format --dry-run --Werror", - warn=True, - ) - if result: - if result.return_code == 127: # Command not found - missing_tools.append("clang-format") - elif not result.ok: - format_errors.append("C files") - - print("Checking Python file formatting...") - result = c.run("black --check tasks.py", warn=True) - if result: - if result.return_code == 127: - missing_tools.append("black") - elif not result.ok: - format_errors.append("Python files") - - print("Checking Nix file formatting...") - result = c.run("nixfmt --check flake.nix", warn=True) - if result: - if result.return_code == 127: - missing_tools.append("nixfmt") - elif not result.ok: - format_errors.append("Nix files") - - print("Checking other file formatting...") - result = c.run("prettier --check '**/*.{js,json,yaml,yml,md,html,css}'", warn=True) - if result: - if result.return_code == 127: - missing_tools.append("prettier") - elif not result.ok: - format_errors.append("JS/JSON/YAML/HTML/CSS files") - - if missing_tools: - print(f"\n❌ ERROR: Missing formatting tools: {', '.join(missing_tools)}") - print("Please install them or reload the nix-shell.") - sys.exit(1) - - if format_errors: - print(f"\n❌ ERROR: Formatting issues in: {', '.join(format_errors)}") - print("Run 'invoke format' to fix them.") - sys.exit(1) - - print("\n✅ All files are correctly formatted!") - - @task(help={"o": "Open documentation in the default browser after generation."}) def docs(c, o=False): """Generate Doxygen documentation."""