Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged

Conversation

alex-torok
Copy link
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.

@aignas
Copy link
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
Contributor Author

Rebased & changelog entry added.

Copy link
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 bazelbuild:main with commit 04e2f32 Aug 21, 2024
4 checks passed
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