Skip to content

Improve lint driver entrypoint#124

Merged
BD103 merged 2 commits intomainfrom
lint-driver-improvements
Oct 6, 2024
Merged

Improve lint driver entrypoint#124
BD103 merged 2 commits intomainfrom
lint-driver-improvements

Conversation

@BD103
Copy link
Copy Markdown
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
@BD103 BD103 marked this pull request as ready for review October 4, 2024 12:41
Copy link
Copy Markdown
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
Copy Markdown
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
@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