Add ruff to the tree formatter so Python sources are kept consistently formatted by 'nix fmt' and the CI format check. Test fixtures under tests/modules are excluded since some are intentionally invalid Python. Reformats the existing lib/python and tests scripts accordingly.
30 lines
621 B
Python
Executable File
30 lines
621 B
Python
Executable File
#!/usr/bin/env python3
|
|
"""
|
|
Validate maintainers.nix syntax
|
|
|
|
This script validates that the maintainers.nix file has valid Nix syntax.
|
|
"""
|
|
|
|
import subprocess
|
|
import sys
|
|
|
|
|
|
def main():
|
|
print("🔍 Validating maintainers.nix syntax...")
|
|
|
|
try:
|
|
subprocess.run(
|
|
["nix", "eval", "--file", "modules/lib/maintainers.nix", "--json"],
|
|
capture_output=True,
|
|
text=True,
|
|
check=True,
|
|
)
|
|
print("✅ Valid Nix syntax")
|
|
except subprocess.CalledProcessError:
|
|
print("❌ Invalid Nix syntax")
|
|
sys.exit(1)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|