mirror of
https://github.com/kevinveenbirkenbach/homepage.veen.world.git
synced 2026-04-07 05:12:19 +00:00
- Replace requirements.txt with pyproject.toml for modern Python packaging - Add unit, integration, lint and security test suites under tests/ - Add utils/export_runtime_requirements.py and utils/check_hadolint_sarif.py - Split monolithic CI into reusable lint.yml, security.yml and tests.yml - Refactor ci.yml to orchestrate reusable workflows; publish on semver tag only - Modernize Dockerfile: pin python:3.12-slim, install via pyproject.toml - Expand Makefile with lint, security, test and CI targets - Add test-e2e via act with portfolio container stop/start around run - Fix navbar_logo_visibility.spec.js: win.fullscreen() → win.enterFullscreen() - Set use_reloader=False in app.run() to prevent double-start in CI - Add app/core.* and build artifacts to .gitignore - Fix apt-get → sudo apt-get in tests.yml e2e job - Fix pip install --ignore-installed to handle stale act cache Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
29 lines
880 B
Python
29 lines
880 B
Python
#!/usr/bin/env python3
|
|
"""Fail when a hadolint SARIF report contains warnings or errors."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import json
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
|
|
def main(argv: list[str] | None = None) -> int:
|
|
args = argv if argv is not None else sys.argv[1:]
|
|
sarif_path = Path(args[0] if args else "hadolint-results.sarif")
|
|
|
|
with sarif_path.open("r", encoding="utf-8") as handle:
|
|
sarif = json.load(handle)
|
|
|
|
results = sarif.get("runs", [{}])[0].get("results", [])
|
|
levels = [result.get("level", "") for result in results]
|
|
warnings = sum(1 for level in levels if level == "warning")
|
|
errors = sum(1 for level in levels if level == "error")
|
|
|
|
print(f"SARIF results: total={len(results)} warnings={warnings} errors={errors}")
|
|
return 1 if warnings + errors > 0 else 0
|
|
|
|
|
|
if __name__ == "__main__":
|
|
raise SystemExit(main())
|