-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Bevy linter #1602
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
Comments
As suggested in the discord, this can also be done as a procedural macro. |
Dylint is a new crate that dynamically loads custom lints and then runs them with a cargo command. This seems like the perfect tool for us to use here. |
Decrees for
|
An existing project for defining custom lints in Rust that could use help getting off the ground: https://github.com./rust-linting |
A dylint-based prototype has been made by @MinerSebas: https://github.com./MinerSebas/bevy_lint |
I've written up a few of our use cases for this in the new |
What problem does this solve or what need does it fill?
A linter could be quite helpful to catch and help correct obvious mistakes in ways the compiler can't, or warn about bad practices in Bevy code.
What solution would you like?
A command line tool is introduced to lint Bevy apps. As some initial ideas, this could catch:
Not<With<T>>
orNot<Without<T>>
or the likeWhat alternative(s) have you considered?
Some of this can be implemented either in compiler errors or run-time errors / warnings. The former has serious technical limitations (see #1519), and the latter is noisy and hard to configure.
Clippy doesn't appear to support custom lints, but it would be quite nice to integrate with it if it did.
Additional context
This is not super high priority, but serves as a nice place to track features that we could put in it. This would be part of #436, but should be able to stand alone.
The text was updated successfully, but these errors were encountered: