Skip to content

Commit 7858db1

Browse files
committed
updated sarif formatter
1 parent 4b53499 commit 7858db1

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

src/formatters/sarif_formatter.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
"""
2-
SARIF Formatter for TerraSecure
3-
--------------------------------
4-
Generates SARIF 2.1.0 output for GitHub Security integration
5-
"""
6-
71
import json
82
from typing import List, Dict, Any
93

@@ -126,7 +120,7 @@ def _build_results(self, findings: List[Dict[str, Any]]) -> List[Dict[str, Any]]
126120
'low': 'note'
127121
}.get(severity, 'warning')
128122

129-
# Ensure line number is >= 1 (GitHub requirement)
123+
# Ensure line number is >= 1
130124
line_number = max(1, finding.get('line', 1))
131125

132126
# Build message text
@@ -190,7 +184,7 @@ def _build_results(self, findings: List[Dict[str, Any]]) -> List[Dict[str, Any]]
190184
"startLine": line_number
191185
},
192186
"insertedContent": {
193-
"text": finding.get('remediation', '')[:500] # Limit length
187+
"text": finding.get('remediation', '')[:500]
194188
}
195189
}
196190
]

0 commit comments

Comments
 (0)