fix(report): correct csv_path indentation in write_vulnerabilities (#637)
Line 72 was over-indented, causing an IndentationError on import of strix/report/writer.py and breaking main. Also bump the mirrors-mypy pre-commit hook to v1.17.1 to avoid the mypy 1.16.0 internal crash (python/mypy#19412) on openai/_client.py.
This commit is contained in:
@@ -11,7 +11,7 @@ repos:
|
|||||||
|
|
||||||
# MyPy for static type checking
|
# MyPy for static type checking
|
||||||
- repo: https://github.com/pre-commit/mirrors-mypy
|
- repo: https://github.com/pre-commit/mirrors-mypy
|
||||||
rev: v1.16.0
|
rev: v1.17.1
|
||||||
hooks:
|
hooks:
|
||||||
- id: mypy
|
- id: mypy
|
||||||
additional_dependencies: [
|
additional_dependencies: [
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ def write_vulnerabilities(
|
|||||||
vulnerability_reports,
|
vulnerability_reports,
|
||||||
key=lambda r: (_SEVERITY_ORDER.get(r["severity"], 5), r["timestamp"]),
|
key=lambda r: (_SEVERITY_ORDER.get(r["severity"], 5), r["timestamp"]),
|
||||||
)
|
)
|
||||||
csv_path = run_dir / "vulnerabilities.csv"
|
csv_path = run_dir / "vulnerabilities.csv"
|
||||||
csv_buf = io.StringIO()
|
csv_buf = io.StringIO()
|
||||||
fieldnames = ["id", "title", "severity", "timestamp", "file"]
|
fieldnames = ["id", "title", "severity", "timestamp", "file"]
|
||||||
csv_writer = csv.DictWriter(csv_buf, fieldnames=fieldnames, lineterminator="\r\n")
|
csv_writer = csv.DictWriter(csv_buf, fieldnames=fieldnames, lineterminator="\r\n")
|
||||||
|
|||||||
Reference in New Issue
Block a user