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

Improve lint driver entrypoint #124

Merged
merged 2 commits into from
Oct 6, 2024
Merged

Improve lint driver entrypoint #124

merged 2 commits into from
Oct 6, 2024

Conversation

BD103
Copy link
Member

@BD103 BD103 commented Oct 4, 2024

This makes the bevy_lint_driver binary behave a bit more like clippy-driver, which means it also behaves a bit more like rustc. Some changes include:

  • Panicking will now result in an ICE, which can be used to debug issues.
  • Logging is now setup, so you can set the RUSTC_LOG variable to configure logging levels and scope. (It uses tracing internally!)
  • Exit code logic now mirrors the functionality recommended for rustc drivers: specifically using catch_with_exit_code().

I'm currently debugging an issue with this where serde_derive fails to compile (I believe it's the rustc_driver::args::raw_args() call), so I'll update this when I fix it. :)

@BD103 BD103 added A-Linter Related to the linter and custom lints C-Usability An improvement that makes the API more pleasant labels Oct 4, 2024
bevy_lint/src/bin/driver.rs Outdated Show resolved Hide resolved
@BD103 BD103 marked this pull request as ready for review October 4, 2024 12:41
Copy link
Collaborator

@TimJentzsch TimJentzsch left a comment

Choose a reason for hiding this comment

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

Code looks good to me, although I don't really have any experience with the rustc internals :)

@BD103
Copy link
Member Author

BD103 commented Oct 6, 2024

although I don't really have any experience with the rustc internals :)

That's fine! I don't expect you to know rustc internals, I just want a second set of eyes for testing and code quality reasons. :)

@BD103 BD103 merged commit 5be367e into main Oct 6, 2024
7 checks passed
@BD103 BD103 deleted the lint-driver-improvements branch October 6, 2024 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Linter Related to the linter and custom lints C-Usability An improvement that makes the API more pleasant
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants