Compare commits

...

1 Commits

Author SHA1 Message Date
Alexander Whitestone
381da49747 fix: add python3 shebang to bin/glitch_patterns.py (#681)
Some checks failed
Architecture Lint / Lint Repository (pull_request) Blocked by required conditions
Validate Config / Python Test Suite (pull_request) Blocked by required conditions
Architecture Lint / Linter Tests (pull_request) Successful in 22s
Smoke Test / smoke (pull_request) Failing after 23s
Validate Config / YAML Lint (pull_request) Failing after 24s
Validate Config / JSON Validate (pull_request) Successful in 28s
Validate Config / Python Syntax & Import Check (pull_request) Failing after 1m17s
Validate Config / Shell Script Lint (pull_request) Failing after 1m11s
Validate Config / Cron Syntax Check (pull_request) Successful in 22s
Validate Config / Deploy Script Dry Run (pull_request) Successful in 15s
Validate Config / Playbook Schema Validation (pull_request) Successful in 31s
PR Checklist / pr-checklist (pull_request) Failing after 11m13s
bin/glitch_patterns.py:
  Added #!/usr/bin/env python3 as first line
  (was the only file from the issue list missing a shebang)

Other files listed in #681 already have shebangs:
  bin/nostr-agent-demo.py    ✓
  bin/soul_eval_gate.py      ✓
  scripts/captcha_bypass_handler.py ✓
  scripts/diagram_meaning_extractor.py ✓
  scripts/visual_pr_reviewer.py ✓

tests/test_shebangs.py: 2 tests + 17 subtests
  Verifies all issue-listed files have shebangs
  Verifies all bin/*.py files have shebangs
2026-04-15 21:37:22 -04:00
2 changed files with 54 additions and 0 deletions

View File

@@ -1,3 +1,4 @@
#!/usr/bin/env python3
"""
Glitch pattern definitions for 3D world anomaly detection.

53
tests/test_shebangs.py Normal file
View File

@@ -0,0 +1,53 @@
"""
Tests for #681 — Python scripts have shebangs.
"""
import os
import unittest
from pathlib import Path
REPO_ROOT = Path(__file__).parent.parent
# Files mentioned in issue #681
ISSUE_FILES = [
"bin/glitch_patterns.py",
"bin/nostr-agent-demo.py",
"bin/soul_eval_gate.py",
"scripts/captcha_bypass_handler.py",
"scripts/diagram_meaning_extractor.py",
"scripts/visual_pr_reviewer.py",
]
class TestShebangs(unittest.TestCase):
def test_all_issue_files_have_shebangs(self):
"""All files listed in #681 have #!/usr/bin/env python3 shebang."""
for relpath in ISSUE_FILES:
filepath = REPO_ROOT / relpath
with self.subTest(file=relpath):
self.assertTrue(filepath.exists(), f"{relpath} not found")
with open(filepath) as f:
first_line = f.readline().strip()
self.assertEqual(
first_line, "#!/usr/bin/env python3",
f"{relpath} missing shebang, first line: {first_line}"
)
def test_bin_scripts_have_shebangs(self):
"""All .py files in bin/ have shebangs."""
bin_dir = REPO_ROOT / "bin"
if not bin_dir.exists():
self.skipTest("bin/ not found")
for filepath in bin_dir.glob("*.py"):
with self.subTest(file=filepath.name):
with open(filepath) as f:
first_line = f.readline().strip()
self.assertTrue(
first_line.startswith("#!"),
f"bin/{filepath.name} missing shebang"
)
if __name__ == "__main__":
unittest.main()