From fa6a988c2a48ce6ceeb57090bcdc397174843719 Mon Sep 17 00:00:00 2001 From: Daniel Flook Date: Thu, 23 Jan 2025 19:11:34 +0000 Subject: [PATCH] Resolve actions command warning If line and endLine are different (like a range usually is), then it can't cope with col and endColumn being set: ``` Invalid error command value. 'col' and 'endColumn' cannot be set if 'line' and 'endLine' are different values. ``` --- image/tools/convert_validate_report.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/image/tools/convert_validate_report.py b/image/tools/convert_validate_report.py index fa4392bb..ebccd19e 100755 --- a/image/tools/convert_validate_report.py +++ b/image/tools/convert_validate_report.py @@ -25,6 +25,13 @@ def convert_to_github(report: Dict, base_path: str) -> Iterable[str]: params['endLine'] = diag['range']['end']['line'] params['endColumn'] = diag['range']['end']['column'] + if params.get('line') != params.get('endLine'): + # GitHub can't cope with 'col' and 'endColumn' if 'line' and 'endLine' are different values. + if 'col' in params: + del params['col'] + if 'endColumn' in params: + del params['endColumn'] + summary = diag['summary'].split('\n')[0] params = ','.join(f'{k}={v}' for k, v in params.items())