Skip to content

feat(gazelle): Update resolve.go to provide more human-friendly error output#2120

Merged
aignas merged 1 commit intobazel-contrib:mainfrom
alex-torok:improve-error-messages-for-deps-errors
Aug 21, 2024
Merged

feat(gazelle): Update resolve.go to provide more human-friendly error output#2120
aignas merged 1 commit intobazel-contrib:mainfrom
alex-torok:improve-error-messages-for-deps-errors

Conversation

@alex-torok
Copy link
Copy Markdown
Contributor

@alex-torok alex-torok commented Aug 13, 2024

Update the Resolver error messages in resolve.go to be easier to read.

While enabling gazelle in an existing repo, I found it somewhat difficult to skim the error messages. This PR:

  1. Adds a bit of whitespace to spread different pieces of information out
  2. Provides an additional remediation action for ambiguous import resolution
  3. Moves the filename and line number where the error is to the front of the line.
  4. Provides more concrete "gazelle:resolve py" directive examples for each errored dep resolution.

Additionally, update a testcase to showcase the ambiguous import resolution error case. See the test.yaml file diff for an example of the old vs new error output.

@alex-torok alex-torok requested a review from f0rmiga as a code owner August 13, 2024 18:35
@aignas
Copy link
Copy Markdown
Collaborator

aignas commented Aug 16, 2024

LGTM, could you please rebase and add a changelog.md item?

@alex-torok alex-torok force-pushed the improve-error-messages-for-deps-errors branch from e49ada1 to 5b7e8cf Compare August 19, 2024 19:56
@alex-torok
Copy link
Copy Markdown
Contributor Author

Rebased & changelog entry added.

Copy link
Copy Markdown
Collaborator

@aignas aignas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@aignas aignas added this pull request to the merge queue Aug 21, 2024
Merged via the queue into bazel-contrib:main with commit 04e2f32 Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants