Skip to content

Commit dad46cf

Browse files
committed
Fix parsing of lint messages in ruff and pyrefly handlers
1 parent 14b2bae commit dad46cf

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

extensions/fine_python_pyrefly/fine_python_pyrefly/lint_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def map_pyrefly_error_to_lint_message(error: dict) -> lint_action.LintMessage:
117117
end_column = error['stop_column']
118118

119119
# Determine severity based on error type
120-
error_code = error.get('code', '')
120+
error_code = str(error.get('code', ''))
121121
code_description = error.get("name", "")
122122
severity = lint_action.LintMessageSeverity.ERROR
123123

extensions/fine_python_ruff/fine_python_ruff/lint_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def map_ruff_violation_to_lint_message(violation: dict) -> lint_action.LintMessa
135135
# Extract line/column info (ruff uses 1-based indexing)
136136
start_line = max(1, location.get("row", 1))
137137
start_column = max(0, location.get("column", 0))
138-
end_line = max(1, end_location.get("row", start_line + 1)) - 1 # Convert to 0-based
138+
end_line = max(1, end_location.get("row", start_line + 1))
139139
end_column = max(0, end_location.get("column", start_column))
140140

141141
# Determine severity based on rule code

0 commit comments

Comments
 (0)