- Introduced `kicad_cli.sh` for local and Docker-based kicad-cli execution. - Created `schops.py` for schematic operations including ERC, BOM, netlist exports, and bulk edits. - Added README.md for schops with installation and usage instructions. - Included requirements.txt for necessary Python packages. - Implemented rules engine for applying field defaults and renaming nets. - Added tests for rules engine functionality. - Introduced scope guard script to enforce file modification policies based on PR labels. - Created watch script to monitor KiCad files and trigger hardware gate on changes.
19 lines
672 B
Python
19 lines
672 B
Python
#!/usr/bin/env python3
|
|
"""Very small diff helper for BOM/netlist exports (placeholder)."""
|
|
import sys
|
|
from pathlib import Path
|
|
import difflib
|
|
|
|
def main():
|
|
if len(sys.argv) != 4:
|
|
print("usage: hw_diff.py <before> <after> <out.md>", file=sys.stderr)
|
|
return 2
|
|
before = Path(sys.argv[1]).read_text(encoding="utf-8", errors="ignore").splitlines()
|
|
after = Path(sys.argv[2]).read_text(encoding="utf-8", errors="ignore").splitlines()
|
|
diff = difflib.unified_diff(before, after, fromfile="before", tofile="after", lineterm="")
|
|
Path(sys.argv[3]).write_text("\n".join(diff) + "\n", encoding="utf-8")
|
|
return 0
|
|
|
|
if __name__ == "__main__":
|
|
raise SystemExit(main())
|