fix: interpret span correctly for github format#1621
Open
SoMuchForSubtlety wants to merge 2 commits intogoogleapis:mainfrom
Open
fix: interpret span correctly for github format#1621SoMuchForSubtlety wants to merge 2 commits intogoogleapis:mainfrom
SoMuchForSubtlety wants to merge 2 commits intogoogleapis:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors GitHub Actions output formatting by exporting and utilizing the FileLocation and Position types from the lint package. The manual span processing in github_actions.go is replaced with FileLocationFromPBLocation, and tests are updated to reflect the new output. Feedback includes suggestions to simplify formatting logic, correct a capitalization error in a comment, and improve documentation for the newly exported functions.
Reuse location logic from the lint package The old location logic had two bugs - keeping locations zero-indexed - interpreting end column as end line in case of span size 3
52e51be to
76a76d4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The old location logic had two bugs
I decided to reuse the existing correct implementation from the lint package. I can re-implement it if you would prefer not to expose this API.
I also fixed newlines, github does not support
\n, but at least partially supports%0A, see actions/toolkit#193