Skip to content

Commit

Permalink
Sort issues by stringified location to avoid sorting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Sija committed Feb 18, 2025
1 parent 27d8270 commit 92332eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ameba/runner.cr
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ module Ameba

File.write(source.path, source.code) unless corrected_issues.empty?
ensure
missing_location = Crystal::Location.new(nil, 0, 0)
missing_location = Crystal::Location.new(nil, 0, 0).to_s
source.issues.sort_by! do |issue|
issue.location || missing_location
issue.location.try(&.to_s) || missing_location
end
@formatter.source_finished source
end
Expand Down

0 comments on commit 92332eb

Please sign in to comment.