Skip to content

Commit

Permalink
Resolve actions command warning
Browse files Browse the repository at this point in the history
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.
```
  • Loading branch information
dflook committed Jan 23, 2025
1 parent 81f352f commit fa6a988
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions image/tools/convert_validate_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())

Expand Down

0 comments on commit fa6a988

Please sign in to comment.