Skip to content

Commit 59c95eb

Browse files
committed
misc: Remove ./ prefix from path
1 parent b0056de commit 59c95eb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

scripts/typos_json_to_gha.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def main():
88

99
# Standard Github message template for CI annotations
1010
message_template = Template(
11-
'::error file=$path,line=$line_num,col=$byte_offset,endColumn=$end_col,'
11+
'::error file=$xpath,line=$line_num,col=$byte_offset,endColumn=$end_col,'
1212
'title=$type::`$typo` should be $suggestions'
1313
)
1414

@@ -24,10 +24,12 @@ def main():
2424
# Calculate the end column and format the correction
2525
suggestions = ', '.join(data['corrections'])
2626
end_col = data['byte_offset'] + len(data['typo'])
27+
# Remove './' from the start of the path
28+
xpath = data['path'].removeprefix('./')
2729

2830
# Print the templated message to stdout
2931
print(message_template.safe_substitute(
30-
data, end_col=end_col, suggestions=suggestions
32+
data, xpath=xpath, end_col=end_col, suggestions=suggestions
3133
))
3234
except KeyError:
3335
print('KeyError')

0 commit comments

Comments
 (0)