Skip to content

Commit

Permalink
modified
Browse files Browse the repository at this point in the history
  • Loading branch information
sailajakommineni committed Nov 24, 2023
1 parent 9031788 commit da5b413
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/spellcheck.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,14 @@ jobs:
# Print grammar errors with line numbers
if matches:
for match in matches:
line_range = match.context[0]['offset']
start_line = text.count('\n', 0, int(line_range)) + 1
end_line = text.count('\n', int(line_range), int(line_range) + match.context[0]['length']) + 1
print(f"Grammar error from line {start_line} to {end_line}: {match.message}")
print("Match context:", match.context)
if match.context and 'offset' in match.context[0]:
line_range = match.context[0]['offset']
start_line = text.count('\n', 0, int(line_range)) + 1
end_line = text.count('\n', int(line_range), int(line_range) + match.context[0]['length']) + 1
print(f"Grammar error from line {start_line} to {end_line}: {match.message}")
else:
print("Unexpected match context structure:", match.context)
# # Exit with a non-zero code to indicate failure
# exit(1)

Expand Down

0 comments on commit da5b413

Please sign in to comment.