Hello! It's #bevy Lint Laundry Day, meaning I'll be spending the entirety of today working on the Bevy Linter! I'll be adding updates here showing what goes on behind-the-scenes of a #rust #opensource #gamedev project, which you can find at https://github.com/TheBevyFlock/bevy_cli.
To begin, I'm going to continue my work improving the linter's documentation. Right now the lint group definitions are separated from the lints, meaning they're harder to discover! Let's move them a little closer together, and add examples on how to use them as well! (https://github.com/TheBevyFlock/bevy_cli/issues/320)
Fantastic, I just finished reorganizing our lint groups and am quite pleased with the result in https://github.com/TheBevyFlock/bevy_cli/pull/328. As lint groups are the easiest way to enable the lints you may want, I'm trying to make them much more visible in the documentation.
It's now much easier to discover the full list of lint groups by looking at the `crate::lints` page. Each lint is organized in a submodule based on its lint group, such as `crate::lints::suspicious`, which makes it easier to learn which lints are in what groups.
Overall, it's a great improvement to our documentation (https://thebevyflock.github.io/bevy_cli/) and internal code structure!
Next up, we have https://github.com/TheBevyFlock/bevy_cli/pull/329 that adds a page on coding conventions for the contributor's guide.
As I've worked more and more with `rustc`'s API, I have found common tasks that all lints must do and certain APIs that should be avoided. This page documents these things and provides a standardized solution.
The end-goal behind this page is to help keep the code consistent. Consistent code makes the user-experience smoother and makes it easier for developers to read the code!
Speaking of contributor's guide, you should consider checking it out! It's a great resource if you want to help out, or simply want to learn more about how `rustc` works.
https://github.com/TheBevyFlock/bevy_cli/tree/main/bevy_lint/docs
After that, I left a review on https://github.com/TheBevyFlock/bevy_cli/pull/323. It's a PR by the lovely DaAlbrecht that updates the linter to support Bevy 0.16! Though Bevy 0.16 has not officially released yet, it's just around the corner. I'm planning on publishing a new version of the linter (v0.3.0-rc.1 or v0.3.0) when that happens so that developers can use it in Bevy Jam #6!
Updating the linter to support a new version of Bevy isn't terribly challenging, but it has its moments! For example, in order to check if your code uses a specific type, we hard-code the absolute path to that type in one giant file (https://github.com/TheBevyFlock/bevy_cli/blob/c05ac1982278220a4fb5bf031546fc75e7916386/bevy_lint/src/paths.rs). If a type gets moved across versions, even if it was within a private module, we still have to update that file for it to work! This is part of the reason why the linter doesn't support multiple versions of Bevy yet.
Either way, DaAlbrecht's work is excellent; I just have a few minor changes before it can be merged.
One thing I did notice was that our CI was calling the `install-linux-deps` action twice! This action installs `alsa` and `udev` when called on a Linux runner, which are both dependencies need by Bevy to compile. There's no point installing them twice, though! I opened a small PR to fix this as well:
And that concludes #bevy Lint Laundry Day! I ended up getting nerd-sniped by an inconsistent API change to Bevy's `Query::many()` method, so I spent the past few hours working on https://github.com/bevyengine/bevy/pull/18615.
Either way, that was a solid day of productive work. I hope you enjoyed the behind-the-scenes tour! :)